Mercurial > hg > Members > kono > compiler-examples
changeset 10:745c62bbc200 current
*** empty log message ***
author | kono |
---|---|
date | Fri, 09 Nov 2007 16:23:32 +0900 |
parents | bd295bb268a4 |
children | c8e3b90ba2d9 |
files | Makefile calc.s calc.s.gcc calc.s.rs6k output.s s-code-intel-mac.c s-compile.c s-tree-compile.c |
diffstat | 8 files changed, 22 insertions(+), 4008 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Fri Nov 09 15:36:02 2007 +0900 +++ b/Makefile Fri Nov 09 16:23:32 2007 +0900 @@ -1,10 +1,10 @@ -TEST = s-intel-r +TEST = s-imac CC = gcc CFLAGS = -g YYFLAGS = -v -COMPILER = s-compile.o s-token.o -# COMPILER = s-tree-compile.o s-token.o +# COMPILER = s-compile.o s-token.o +COMPILER = s-tree-compile.o s-token.o # COMPILER = s-yacc.o s-token.o # TARGET = token calc s-calc s-prefix s-rpn s-09 s-intel s-intel-r s-sparc s-rs6k s-m68k s-ppc s-imac @@ -62,72 +62,12 @@ $(MC09ASM) s-output.a09 $(MC09EMU) s-output +tar: + ( cd ..; tar zcf compiler-examples.tgz --exclude CVS compiler-examples ) + clean: rm -f *.o $(TARGET) a.out s-output.s s-output.a09 s-output rm -f s-yacc.c y.tab.c y.tab.h # DO NOT DELETE -calc.o: /usr/include/stdio.h /usr/include/_types.h /usr/include/sys/_types.h -calc.o: /usr/include/sys/cdefs.h /usr/include/machine/_types.h -calc.o: /usr/include/ppc/_types.h -compile-m68k.o: /usr/include/stdio.h /usr/include/_types.h -compile-m68k.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -compile-m68k.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -compile.o: /usr/include/stdio.h /usr/include/_types.h -compile.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -compile.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-calc-r.o: /usr/include/stdio.h /usr/include/_types.h -s-calc-r.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-calc-r.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-calc.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-calc.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-calc.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-09.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-09.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-09.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-intel-r.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-intel-r.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-intel-r.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-intel.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-intel.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-intel.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-m68k.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-m68k.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-m68k.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-ppc.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-ppc.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-ppc.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-print.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-print.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-print.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-rs6k-r.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-rs6k-r.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-rs6k-r.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-rs6k.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-rs6k.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-rs6k.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-code-sparc.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-code-sparc.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-code-sparc.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-compile.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-compile.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-compile.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-compile.o: /usr/include/stdio.h /usr/include/_types.h -s-compile.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-compile.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-prefix.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-prefix.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-prefix.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-token.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-token.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-token.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-tree-compile.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -s-tree-compile.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-tree-compile.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -s-tree.o: /usr/include/stdio.h /usr/include/_types.h -s-tree.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -s-tree.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h -token.o: s-compile.h /usr/include/stdio.h /usr/include/_types.h -token.o: /usr/include/sys/_types.h /usr/include/sys/cdefs.h -token.o: /usr/include/machine/_types.h /usr/include/ppc/_types.h
--- a/calc.s Fri Nov 09 15:36:02 2007 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,990 +0,0 @@ - .section __TEXT,__text,regular,pure_instructions - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .machine ppc - .text - .align 2 -_line_skip: - mflr r0 - bcl 20,31,"L00000000001$pb" -"L00000000001$pb": - mflr r10 - mtlr r0 - addis r2,r10,ha16(L_ptr$non_lazy_ptr-"L00000000001$pb") - lwz r11,lo16(L_ptr$non_lazy_ptr-"L00000000001$pb")(r2) -L3: - lwz r2,0(r11) - lbz r0,0(r2) - addi r9,r2,1 - stw r9,0(r11) - extsb. r2,r0 - bne cr0,L3 - addis r2,r10,ha16(L_last_ptr$non_lazy_ptr-"L00000000001$pb") - lwz r2,lo16(L_last_ptr$non_lazy_ptr-"L00000000001$pb")(r2) - stw r9,0(r2) - li r0,-1 - addis r2,r10,ha16(L_last_token$non_lazy_ptr-"L00000000001$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000001$pb")(r2) - stw r0,0(r2) - blr - .cstring - .align 2 -LC0: - .ascii "%s on %s\12\0" - .text - .align 2 -_error: - mflr r0 - stw r31,-4(r1) - stw r0,8(r1) - stwu r1,-80(r1) - bcl 20,31,"L00000000002$pb" -"L00000000002$pb": - mflr r31 - mr r5,r3 - addis r3,r31,ha16(L___sF$non_lazy_ptr-"L00000000002$pb") - lwz r3,lo16(L___sF$non_lazy_ptr-"L00000000002$pb")(r3) - addi r3,r3,176 - addis r4,r31,ha16(LC0-"L00000000002$pb") - la r4,lo16(LC0-"L00000000002$pb")(r4) - addis r2,r31,ha16(L_last_ptr$non_lazy_ptr-"L00000000002$pb") - lwz r2,lo16(L_last_ptr$non_lazy_ptr-"L00000000002$pb")(r2) - lwz r6,0(r2) - bl L_fprintf$LDBLStub$stub - bl _line_skip - addi r1,r1,80 - lwz r0,8(r1) - mtlr r0 - lwz r31,-4(r1) - blr - .align 2 -_token: - mflr r0 - stw r31,-4(r1) - stw r0,8(r1) - stwu r1,-80(r1) - bcl 20,31,"L00000000003$pb" -"L00000000003$pb": - mflr r31 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - lwz r9,0(r2) - addis r2,r31,ha16(L_last_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r9,0(r2) - lbz r0,0(r9) - extsb r3,r0 - cmpwi cr7,r3,32 - bgt cr7,L11 - cmpwi cr7,r3,0 - beq cr7,L16 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r9,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) -L13: - lwz r2,0(r9) - addi r0,r2,1 - stw r0,0(r9) - lbz r0,1(r2) - extsb r3,r0 - cmpwi cr7,r3,32 - bgt cr7,L14 - cmpwi cr7,r3,0 - beq cr7,L16 - b L13 -L11: - cmpwi cr7,r3,0 - bne cr7,L14 -L16: - li r0,-1 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,-1 - b L10 -L14: - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - lwz r9,0(r2) - addi r11,r9,1 - stw r11,0(r2) - cmpwi cr7,r3,47 - bne cr7,L18 - lbz r0,1(r9) - extsb r0,r0 - cmpwi cr7,r0,47 - beq cr7,L20 - cmpwi cr7,r0,42 - bne cr7,L18 -L20: - bl _line_skip - li r3,-1 - b L10 -L18: - addi r0,r3,-49 - cmplwi cr7,r0,8 - bgt cr7,L22 - addi r10,r3,-48 - lbz r0,0(r11) - addi r9,r9,2 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r9,0(r2) - extsb. r11,r0 - bne cr0,L24 - b L25 -L26: - addi r0,r11,-48 - cmplwi cr7,r0,9 - bgt cr7,L27 -L88: - mulli r2,r10,10 - add r2,r11,r2 - addi r10,r2,-48 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - lwz r9,0(r2) - lbz r0,0(r9) - addi r9,r9,1 - stw r9,0(r2) - extsb. r11,r0 - bne cr0,L26 - b L25 -L27: - addi r0,r9,-1 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) -L25: - addis r2,r31,ha16(L_value$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_value$non_lazy_ptr-"L00000000003$pb")(r2) - stw r10,0(r2) - li r0,48 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,48 - b L10 -L22: - cmpwi cr7,r3,48 - bne cr7,L29 - lbz r0,0(r11) - extsb r0,r0 - cmpwi cr7,r0,120 - bne cr7,L31 - addi r0,r9,2 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r11,0 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r10,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - b L93 -L34: - addi r0,r9,-48 - cmplwi cr7,r0,9 - bgt cr7,L35 - slwi r2,r11,4 - add r2,r9,r2 - addi r11,r2,-48 - b L93 -L35: - addi r0,r9,-97 - cmplwi cr7,r0,5 - bgt cr7,L37 - slwi r2,r11,4 - add r2,r9,r2 - addi r11,r2,-87 - b L93 -L37: - addi r0,r9,-65 - cmplwi cr7,r0,5 - bgt cr7,L39 - slwi r2,r11,4 - add r2,r9,r2 - addi r11,r2,-87 -L93: - lwz r2,0(r10) - lbz r0,0(r2) - extsb r0,r0 - mr r9,r0 - addi r2,r2,1 - stw r2,0(r10) - cmpwi cr7,r0,0 - bne cr7,L34 - b L41 -L39: - addi r0,r2,-1 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) -L41: - addis r2,r31,ha16(L_value$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_value$non_lazy_ptr-"L00000000003$pb")(r2) - stw r11,0(r2) - li r0,48 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,48 - b L10 -L42: - addi r0,r11,-48 - cmplwi cr7,r0,7 - bgt cr7,L43 -L44: - slwi r2,r10,3 - add r2,r11,r2 - addi r10,r2,-48 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - lwz r9,0(r2) - lbz r0,0(r9) - addi r9,r9,1 - stw r9,0(r2) - extsb. r11,r0 - bne cr0,L42 - b L45 -L46: - li r10,0 -L43: - addi r0,r9,-1 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) -L45: - addis r2,r31,ha16(L_value$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_value$non_lazy_ptr-"L00000000003$pb")(r2) - stw r10,0(r2) - li r0,48 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,48 - b L10 -L29: - cmpwi cr7,r3,39 - bne cr7,L47 - li r7,0 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r8,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - b L94 -L50: - cmpwi cr7,r0,39 - beq cr7,L51 - cmpwi cr7,r2,127 - bgt cr7,L53 - slwi r0,r7,8 - add r7,r2,r0 - b L94 -L51: - cmpwi cr7,r2,127 - ble cr7,L55 -L53: - lbz r0,0(r11) - extsb. r10,r0 - beq cr0,L55 - slwi r0,r7,8 - add r0,r2,r0 - slwi r0,r0,8 - add r7,r0,r10 - addi r0,r9,2 - stw r0,0(r8) -L94: - lwz r9,0(r8) - lbz r0,0(r9) - extsb r0,r0 - mr r2,r0 - addi r11,r9,1 - stw r11,0(r8) - cmpwi cr7,r0,0 - bne cr7,L50 - b L57 -L55: - addi r0,r11,-1 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) -L57: - addis r2,r31,ha16(L_value$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_value$non_lazy_ptr-"L00000000003$pb")(r2) - stw r7,0(r2) - li r0,48 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,48 - b L10 -L47: - addi r0,r3,-97 - cmplwi cr7,r0,25 - ble cr7,L58 - addi r0,r3,-65 - cmplwi cr7,r0,25 - bgt cr7,L60 -L58: - addi r0,r3,-71 - cmpwi cr7,r3,90 - bgt cr7,L63 - addi r0,r3,-65 -L63: - addis r2,r31,ha16(L_value$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_value$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r0,118 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,118 - b L10 -L60: - cmpwi cr7,r3,61 - bne cr7,L64 - lbz r0,0(r11) - cmpwi cr7,r0,61 - bne cr7,L66 - addi r0,r9,2 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r0,317 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,317 - b L10 -L64: - cmpwi cr7,r3,33 - bne cr7,L68 - lbz r0,0(r11) - cmpwi cr7,r0,61 - bne cr7,L66 - addi r0,r9,2 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r0,289 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - b L10 -L68: - cmpwi cr7,r3,60 - bne cr7,L71 - lbz r0,0(r11) - cmpwi cr7,r0,60 - bne cr7,L66 - addi r0,r9,2 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r0,316 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,316 - b L10 -L71: - cmpwi cr7,r3,62 - bne cr7,L66 - lbz r0,0(r11) - cmpwi cr7,r0,62 - bne cr7,L66 - addi r0,r9,2 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r0,318 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r0,0(r2) - li r3,318 - b L10 -L66: - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000003$pb")(r2) - stw r3,0(r2) - b L10 -L31: - addi r9,r9,2 - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000003$pb") - lwz r2,lo16(L_ptr$non_lazy_ptr-"L00000000003$pb")(r2) - stw r9,0(r2) - li r10,0 - mr r11,r0 - cmpwi cr7,r0,0 - beq cr7,L45 - addi r0,r11,-48 - cmplwi cr7,r0,7 - ble cr7,L44 - b L46 -L24: - addi r0,r11,-48 - cmplwi cr7,r0,9 - ble cr7,L88 - b L27 -L10: - addi r1,r1,80 - lwz r0,8(r1) - mtlr r0 - lwz r31,-4(r1) - blr - .cstring - .align 2 -LC1: - .ascii "? expression not terminated with :\0" - .align 2 -LC2: - .ascii "Bad assignment\0" - .align 2 -LC3: - .ascii "Bad expression\0" - .text - .align 2 -_expr: - mflr r0 - stmw r27,-20(r1) - stw r0,8(r1) - stwu r1,-96(r1) - bcl 20,31,"L00000000004$pb" -"L00000000004$pb": - mflr r31 - addis r2,r31,ha16(L_lvalue$non_lazy_ptr-"L00000000004$pb") - lwz r27,lo16(L_lvalue$non_lazy_ptr-"L00000000004$pb")(r2) - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000004$pb") - lwz r28,lo16(L_last_token$non_lazy_ptr-"L00000000004$pb")(r2) -L97: - bl L_aexpr$stub - mr r30,r3 - lwz r29,0(r27) - b L131 -L99: - cmpwi cr7,r0,62 - beq cr7,L104 - bgt cr7,L110 - cmpwi cr7,r0,58 - beq cr7,L101 - bgt cr7,L111 - cmpwi cr7,r0,41 - beq cr7,L101 -L100: - addis r3,r31,ha16(LC3-"L00000000004$pb") - la r3,lo16(LC3-"L00000000004$pb")(r3) - bl _error - bl _token -L131: - lwz r0,0(r28) - cmpwi cr7,r0,-1 - bne cr7,L99 - b L128 -L111: - cmpwi cr7,r0,60 - beq cr7,L102 - cmpwi cr7,r0,61 - bne cr7,L100 - b L103 -L110: - cmpwi cr7,r0,316 - beq cr7,L107 - bgt cr7,L112 - cmpwi cr7,r0,63 - beq cr7,L105 - cmpwi cr7,r0,289 - bne cr7,L100 - b L106 -L112: - cmpwi cr7,r0,317 - beq cr7,L108 - cmpwi cr7,r0,318 - bne cr7,L100 - b L109 -L101: - mr r29,r30 - b L113 -L102: - bl L_aexpr$stub - cmpw cr7,r30,r3 - mfcr r30 - rlwinm r30,r30,29,1 - b L131 -L104: - bl L_aexpr$stub - cmpw cr7,r30,r3 - mfcr r30 - rlwinm r30,r30,30,1 - b L131 -L108: - bl L_aexpr$stub - xor r30,r30,r3 - subfic r0,r30,0 - adde r30,r0,r30 - b L131 -L106: - bl L_aexpr$stub - xor r3,r30,r3 - addic r0,r3,-1 - subfe r30,r0,r3 - b L131 -L107: - bl L_aexpr$stub - slw r30,r30,r3 - b L131 -L109: - bl L_aexpr$stub - sraw r30,r30,r3 - b L131 -L105: - bl _expr - mr r29,r3 - lwz r0,0(r28) - cmpwi cr7,r0,58 - bne cr7,L123 - cmpwi cr7,r30,0 - beq cr7,L97 - bl _expr - b L113 -L103: - cmpwi cr7,r29,0 - blt cr7,L117 - bl _expr - slwi r0,r29,2 - addis r2,r31,ha16(L_variable$non_lazy_ptr-"L00000000004$pb") - lwz r2,lo16(L_variable$non_lazy_ptr-"L00000000004$pb")(r2) - stwx r3,r2,r0 - mr r29,r3 - b L113 -L117: - addis r3,r31,ha16(LC2-"L00000000004$pb") - la r3,lo16(LC2-"L00000000004$pb")(r3) - bl _error - li r29,0 - b L113 -L123: - addis r3,r31,ha16(LC1-"L00000000004$pb") - la r3,lo16(LC1-"L00000000004$pb")(r3) - bl _error - b L113 -L128: - li r0,-1 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000004$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000004$pb")(r2) - stw r0,0(r2) - mr r29,r30 -L113: - mr r3,r29 - addi r1,r1,96 - lwz r0,8(r1) - mtlr r0 - lmw r27,-20(r1) - blr - .align 2 -_aexpr: - mflr r0 - stmw r29,-12(r1) - stw r0,8(r1) - stwu r1,-80(r1) - bcl 20,31,"L00000000005$pb" -"L00000000005$pb": - mflr r31 - bl L_mexpr$stub - mr r30,r3 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000005$pb") - lwz r29,lo16(L_last_token$non_lazy_ptr-"L00000000005$pb")(r2) - b L148 -L134: - cmpwi cr7,r0,45 - beq cr7,L138 - bgt cr7,L141 - cmpwi cr7,r0,38 - beq cr7,L136 - cmpwi cr7,r0,43 - bne cr7,L135 - b L137 -L141: - cmpwi cr7,r0,94 - beq cr7,L139 - cmpwi cr7,r0,124 - bne cr7,L135 - b L140 -L139: - bl L_mexpr$stub - xor r30,r30,r3 - b L148 -L140: - bl L_mexpr$stub - or r30,r30,r3 - b L148 -L136: - bl L_mexpr$stub - and r30,r30,r3 - b L148 -L138: - bl L_mexpr$stub - subf r30,r3,r30 - b L148 -L137: - bl L_mexpr$stub - add r30,r30,r3 -L148: - lwz r0,0(r29) - cmpwi cr7,r0,-1 - bne cr7,L134 -L135: - mr r3,r30 - addi r1,r1,80 - lwz r0,8(r1) - mtlr r0 - lmw r29,-12(r1) - blr - .align 2 -_mexpr: - mflr r0 - stmw r29,-12(r1) - stw r0,8(r1) - stwu r1,-80(r1) - bcl 20,31,"L00000000006$pb" -"L00000000006$pb": - mflr r31 - bl L_term$stub - mr r30,r3 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000006$pb") - lwz r29,lo16(L_last_token$non_lazy_ptr-"L00000000006$pb")(r2) - b L164 -L151: - cmpwi cr7,r0,42 - beq cr7,L154 - bgt cr7,L157 - cmpwi cr7,r0,37 - bne cr7,L152 - b L153 -L157: - cmpwi cr7,r0,47 - beq cr7,L155 - cmpwi cr7,r0,94 - bne cr7,L152 - b L156 -L154: - bl L_term$stub - mullw r30,r30,r3 - b L164 -L155: - bl L_term$stub - divw r30,r30,r3 - b L164 -L153: - bl L_term$stub - divw r0,r30,r3 - mullw r0,r0,r3 - subf r30,r0,r30 - b L164 -L156: - bl L_term$stub - xor r30,r30,r3 -L164: - lwz r0,0(r29) - cmpwi cr7,r0,-1 - bne cr7,L151 -L152: - mr r3,r30 - addi r1,r1,80 - lwz r0,8(r1) - mtlr r0 - lmw r29,-12(r1) - blr - .cstring - .align 2 -LC4: - .ascii "Term expected\0" - .align 2 -LC5: - .ascii "Unbalanced parenthsis\0" - .align 2 -LC6: - .ascii "Unknown term\0" - .text - .align 2 -_term: - mflr r0 - stmw r29,-12(r1) - stw r0,8(r1) - stwu r1,-80(r1) - bcl 20,31,"L00000000007$pb" -"L00000000007$pb": - mflr r31 - li r0,-1 - addis r2,r31,ha16(L_lvalue$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_lvalue$non_lazy_ptr-"L00000000007$pb")(r2) - stw r0,0(r2) - bl _token - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000007$pb")(r2) - lwz r0,0(r2) - cmpwi cr7,r0,-1 - bne cr7,L166 - addis r3,r31,ha16(LC4-"L00000000007$pb") - la r3,lo16(LC4-"L00000000007$pb")(r3) - bl _error -L166: - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000007$pb")(r2) - lwz r2,0(r2) - cmpwi cr7,r2,48 - beq cr7,L172 - bgt cr7,L174 - cmpwi cr7,r2,40 - beq cr7,L170 - cmpwi cr7,r2,45 - beq cr7,L171 - cmpwi cr7,r2,33 - beq cr7,L169 -L168: - bl _token - addis r3,r31,ha16(LC6-"L00000000007$pb") - la r3,lo16(LC6-"L00000000007$pb")(r3) - bl _error - li r29,0 - b L175 -L174: - cmpwi cr7,r2,118 - bne cr7,L168 - b L173 -L172: - addis r2,r31,ha16(L_value$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_value$non_lazy_ptr-"L00000000007$pb")(r2) - lwz r29,0(r2) - bl _token - b L175 -L173: - addis r2,r31,ha16(L_value$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_value$non_lazy_ptr-"L00000000007$pb")(r2) - lwz r29,0(r2) - addis r2,r31,ha16(L_lvalue$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_lvalue$non_lazy_ptr-"L00000000007$pb")(r2) - stw r29,0(r2) - bl _token - slwi r29,r29,2 - addis r2,r31,ha16(L_variable$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_variable$non_lazy_ptr-"L00000000007$pb")(r2) - lwzx r29,r29,r2 - b L175 -L171: - bl _term - neg r29,r3 - b L175 -L169: - bl _term - subfic r0,r3,0 - adde r29,r0,r3 - b L175 -L170: - bl _expr - mr r29,r3 - addis r2,r31,ha16(L_last_token$non_lazy_ptr-"L00000000007$pb") - lwz r2,lo16(L_last_token$non_lazy_ptr-"L00000000007$pb")(r2) - lwz r0,0(r2) - cmpwi cr7,r0,41 - beq cr7,L176 - addis r3,r31,ha16(LC5-"L00000000007$pb") - la r3,lo16(LC5-"L00000000007$pb")(r3) - bl _error -L176: - bl _token -L175: - mr r3,r29 - addi r1,r1,80 - lwz r0,8(r1) - mtlr r0 - lmw r29,-12(r1) - blr - .cstring - .align 2 -LC7: - .ascii "%s = 0x%08x = %d\12\0" - .text - .align 2 - .globl _main -_main: - mflr r0 - stmw r26,-24(r1) - stw r0,8(r1) - stwu r1,-1120(r1) - bcl 20,31,"L00000000008$pb" -"L00000000008$pb": - mflr r31 - addis r26,r31,ha16(L___sF$non_lazy_ptr-"L00000000008$pb") - addis r2,r31,ha16(L_ptr$non_lazy_ptr-"L00000000008$pb") - lwz r27,lo16(L_ptr$non_lazy_ptr-"L00000000008$pb")(r2) - addi r30,r1,56 - addis r28,r31,ha16(LC7-"L00000000008$pb") - lwz r29,lo16(L___sF$non_lazy_ptr-"L00000000008$pb")(r26) - b L180 -L181: - stw r30,0(r27) - bl _expr - mr r6,r3 - la r3,lo16(LC7-"L00000000008$pb")(r28) - mr r4,r30 - mr r5,r6 - bl L_printf$LDBLStub$stub - addi r3,r29,88 - bl L_fflush$stub -L180: - addi r3,r1,56 - li r4,1024 - lwz r5,lo16(L___sF$non_lazy_ptr-"L00000000008$pb")(r26) - bl L_fgets$stub - cmpwi cr7,r3,0 - bne cr7,L181 - addi r1,r1,1120 - lwz r0,8(r1) - mtlr r0 - lmw r26,-24(r1) - blr -.comm _ptr,4 -.comm _last_ptr,4 -.comm _value,4 -.comm _lvalue,4 -.comm _last_token,4 -.comm _variable,192 - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_fgets$stub: - .indirect_symbol _fgets - mflr r0 - bcl 20,31,"L00000000001$spb" -"L00000000001$spb": - mflr r11 - addis r11,r11,ha16(L_fgets$lazy_ptr-"L00000000001$spb") - mtlr r0 - lwzu r12,lo16(L_fgets$lazy_ptr-"L00000000001$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_fgets$lazy_ptr: - .indirect_symbol _fgets - .long dyld_stub_binding_helper - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_printf$LDBLStub$stub: - .indirect_symbol _printf$LDBLStub - mflr r0 - bcl 20,31,"L00000000002$spb" -"L00000000002$spb": - mflr r11 - addis r11,r11,ha16(L_printf$LDBLStub$lazy_ptr-"L00000000002$spb") - mtlr r0 - lwzu r12,lo16(L_printf$LDBLStub$lazy_ptr-"L00000000002$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_printf$LDBLStub$lazy_ptr: - .indirect_symbol _printf$LDBLStub - .long dyld_stub_binding_helper - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_term$stub: - .indirect_symbol _term - mflr r0 - bcl 20,31,"L00000000003$spb" -"L00000000003$spb": - mflr r11 - addis r11,r11,ha16(L_term$lazy_ptr-"L00000000003$spb") - mtlr r0 - lwzu r12,lo16(L_term$lazy_ptr-"L00000000003$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_term$lazy_ptr: - .indirect_symbol _term - .long dyld_stub_binding_helper - .non_lazy_symbol_pointer -L_ptr$non_lazy_ptr: - .indirect_symbol _ptr - .long 0 -L_last_ptr$non_lazy_ptr: - .indirect_symbol _last_ptr - .long 0 - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_mexpr$stub: - .indirect_symbol _mexpr - mflr r0 - bcl 20,31,"L00000000004$spb" -"L00000000004$spb": - mflr r11 - addis r11,r11,ha16(L_mexpr$lazy_ptr-"L00000000004$spb") - mtlr r0 - lwzu r12,lo16(L_mexpr$lazy_ptr-"L00000000004$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_mexpr$lazy_ptr: - .indirect_symbol _mexpr - .long dyld_stub_binding_helper - .non_lazy_symbol_pointer -L_lvalue$non_lazy_ptr: - .indirect_symbol _lvalue - .long 0 - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_aexpr$stub: - .indirect_symbol _aexpr - mflr r0 - bcl 20,31,"L00000000005$spb" -"L00000000005$spb": - mflr r11 - addis r11,r11,ha16(L_aexpr$lazy_ptr-"L00000000005$spb") - mtlr r0 - lwzu r12,lo16(L_aexpr$lazy_ptr-"L00000000005$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_aexpr$lazy_ptr: - .indirect_symbol _aexpr - .long dyld_stub_binding_helper - .non_lazy_symbol_pointer -L_value$non_lazy_ptr: - .indirect_symbol _value - .long 0 -L_variable$non_lazy_ptr: - .indirect_symbol _variable - .long 0 -L_last_token$non_lazy_ptr: - .indirect_symbol _last_token - .long 0 -L___sF$non_lazy_ptr: - .indirect_symbol ___sF - .long 0 - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_fflush$stub: - .indirect_symbol _fflush - mflr r0 - bcl 20,31,"L00000000006$spb" -"L00000000006$spb": - mflr r11 - addis r11,r11,ha16(L_fflush$lazy_ptr-"L00000000006$spb") - mtlr r0 - lwzu r12,lo16(L_fflush$lazy_ptr-"L00000000006$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_fflush$lazy_ptr: - .indirect_symbol _fflush - .long dyld_stub_binding_helper - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_fprintf$LDBLStub$stub: - .indirect_symbol _fprintf$LDBLStub - mflr r0 - bcl 20,31,"L00000000007$spb" -"L00000000007$spb": - mflr r11 - addis r11,r11,ha16(L_fprintf$LDBLStub$lazy_ptr-"L00000000007$spb") - mtlr r0 - lwzu r12,lo16(L_fprintf$LDBLStub$lazy_ptr-"L00000000007$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_fprintf$LDBLStub$lazy_ptr: - .indirect_symbol _fprintf$LDBLStub - .long dyld_stub_binding_helper - .subsections_via_symbols
--- a/calc.s.gcc Fri Nov 09 15:36:02 2007 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1466 +0,0 @@ - .file "calc.c" -.toc -.csect .text[PR] -gcc2_compiled.: -__gnu_compiled_c: -.toc -LC..0: - .tc ptr[TC],ptr -LC..1: - .tc last_ptr[TC],last_ptr -LC..2: - .tc last_token[TC],last_token -.csect .text[PR] - .align 2 - .globl line_skip - .globl .line_skip -.csect line_skip[DS] -line_skip: - .long .line_skip, TOC[tc0], 0 -.csect .text[PR] -.line_skip: - st 31,-4(1) - stu 1,-32(1) - mr 31,1 - cror 0,0,0 -L..2: - l 9,LC..0(2) - l 11,0(9) - cal 0,1(11) - st 0,0(9) - lbz 9,0(11) - rlinm 0,9,0,0xff - cmpi 1,0,0 - bc 12,6,$+8 - b L..4 - b L..3 -L..4: - b L..2 -L..3: - l 9,LC..1(2) - l 11,LC..0(2) - l 0,0(11) - st 0,0(9) - l 9,LC..2(2) - lil 0,-1 - st 0,0(9) -L..1: - l 1,0(1) - l 31,-4(1) - br -LT..line_skip: - .long 0 - .byte 0,0,32,96,128,1,0,1 - .long LT..line_skip-.line_skip - .short 9 - .byte "line_skip" - .byte 31 - .extern fprintf[DS] - .extern .fprintf - .extern _iob[RW] -.csect _calc.rw_c[RO] - .align 2 -LC..3: - .byte "%s on %s" - .byte 10, 0 -.toc -LC..4: - .tc last_ptr[TC],last_ptr -LC..5: - .tc _iob.P64[TC],_iob[RW]+64 -LC..6: - .tc LC..3[TC],LC..3 -.csect .text[PR] - .align 2 - .globl error - .globl .error -.csect error[DS] -error: - .long .error, TOC[tc0], 0 -.csect .text[PR] -.error: - mflr 0 - st 31,-4(1) - st 0,8(1) - stu 1,-64(1) - mr 31,1 - st 3,88(31) - l 9,LC..4(2) - l 3,LC..5(2) - l 4,LC..6(2) - l 5,88(31) - l 6,0(9) - bl .fprintf - cror 31,31,31 - bl .line_skip - cror 31,31,31 -L..5: - l 1,0(1) - l 0,8(1) - mtlr 0 - l 31,-4(1) - br -LT..error: - .long 0 - .byte 0,0,32,97,128,1,1,1 - .long 0 - .long LT..error-.error - .short 5 - .byte "error" - .byte 31 -.toc -LC..7: - .tc last_ptr[TC],last_ptr -LC..8: - .tc ptr[TC],ptr -LC..9: - .tc last_token[TC],last_token -LC..10: - .tc value[TC],value -.csect .text[PR] - .align 2 - .globl token - .globl .token -.csect token[DS] -token: - .long .token, TOC[tc0], 0 -.csect .text[PR] -.token: - mflr 0 - st 31,-4(1) - st 0,8(1) - stu 1,-72(1) - mr 31,1 - l 9,LC..7(2) - l 11,LC..8(2) - l 0,0(11) - st 0,0(9) - l 11,LC..8(2) - l 9,0(11) - lbz 0,0(9) - rlinm 9,0,0,0xff - st 9,56(31) -L..7: - l 0,56(31) - cmpi 1,0,32 - bc 4,5,$+8 - b L..10 - l 0,56(31) - cmpi 1,0,0 - bc 12,6,$+8 - b L..9 - b L..10 -L..10: - b L..8 -L..9: - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 10,0(11) - cal 0,1(10) - mr 11,0 - st 11,0(9) - lbz 0,0(11) - rlinm 9,0,0,0xff - st 9,56(31) - b L..7 -L..8: - l 0,56(31) - cmpi 1,0,0 - bc 12,6,$+8 - b L..11 - l 9,LC..9(2) - lil 0,-1 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 -L..11: - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 10,0(11) - cal 0,1(10) - mr 11,0 - st 11,0(9) - l 0,56(31) - cmpi 1,0,47 - bc 12,6,$+8 - b L..12 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,47 - bc 4,6,$+8 - b L..13 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,42 - bc 4,6,$+8 - b L..13 - b L..12 -L..13: - bl .line_skip - cror 31,31,31 - lil 3,-1 - b L..6 -L..12: - l 0,56(31) - cmpi 1,0,48 - bc 12,5,$+8 - b L..14 - l 0,56(31) - cmpi 1,0,57 - bc 4,5,$+8 - b L..14 - l 0,56(31) - ai 9,0,-48 - st 9,60(31) -L..15: - l 9,LC..8(2) - l 11,0(9) - cal 0,1(11) - st 0,0(9) - lbz 9,0(11) - rlinm 0,9,0,0xff - mr 9,0 - st 9,56(31) - cmpi 1,9,0 - bc 12,6,$+8 - b L..17 - b L..16 -L..17: - l 0,56(31) - cmpi 1,0,47 - bc 12,5,$+8 - b L..18 - l 0,56(31) - cmpi 1,0,57 - bc 4,5,$+8 - b L..18 - l 9,60(31) - muli 0,9,10 - ai 9,0,-48 - l 0,56(31) - cax 9,9,0 - st 9,60(31) - b L..19 -L..18: - b L..16 -L..19: - b L..15 -L..16: - l 0,56(31) - cmpi 1,0,0 - bc 4,6,$+8 - b L..20 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 0,0(11) - ai 11,0,-1 - mr 0,11 - st 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 4,6,$+8 - b L..20 -L..20: - l 9,LC..10(2) - l 0,60(31) - st 0,0(9) - l 9,LC..9(2) - lil 0,48 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..21 -L..14: - l 0,56(31) - cmpi 1,0,48 - bc 12,6,$+8 - b L..22 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,120 - bc 12,6,$+8 - b L..22 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 10,0(11) - cal 0,1(10) - mr 11,0 - st 11,0(9) - lil 0,0 - st 0,60(31) -L..23: - l 9,LC..8(2) - l 11,0(9) - cal 0,1(11) - st 0,0(9) - lbz 9,0(11) - rlinm 0,9,0,0xff - mr 9,0 - st 9,56(31) - cmpi 1,9,0 - bc 12,6,$+8 - b L..25 - b L..24 -L..25: - l 0,56(31) - cmpi 1,0,47 - bc 12,5,$+8 - b L..26 - l 0,56(31) - cmpi 1,0,57 - bc 4,5,$+8 - b L..26 - l 0,60(31) - mr 9,0 - sli 0,9,4 - ai 9,0,-48 - l 0,56(31) - cax 9,9,0 - st 9,60(31) - b L..27 -L..26: - l 0,56(31) - cmpi 1,0,96 - bc 12,5,$+8 - b L..28 - l 0,56(31) - cmpi 1,0,102 - bc 4,5,$+8 - b L..28 - l 0,60(31) - mr 9,0 - sli 0,9,4 - ai 9,0,-87 - l 0,56(31) - cax 9,9,0 - st 9,60(31) - b L..29 -L..28: - l 0,56(31) - cmpi 1,0,64 - bc 12,5,$+8 - b L..30 - l 0,56(31) - cmpi 1,0,70 - bc 4,5,$+8 - b L..30 - l 0,60(31) - mr 9,0 - sli 0,9,4 - ai 9,0,-87 - l 0,56(31) - cax 9,9,0 - st 9,60(31) - b L..31 -L..30: - b L..24 -L..31: -L..29: -L..27: - b L..23 -L..24: - l 0,56(31) - cmpi 1,0,0 - bc 4,6,$+8 - b L..32 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 0,0(11) - ai 11,0,-1 - mr 0,11 - st 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 4,6,$+8 - b L..32 -L..32: - l 9,LC..10(2) - l 0,60(31) - st 0,0(9) - l 9,LC..9(2) - lil 0,48 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..33 -L..22: - l 0,56(31) - cmpi 1,0,48 - bc 12,6,$+8 - b L..34 - l 0,56(31) - ai 9,0,-48 - st 9,60(31) -L..35: - l 9,LC..8(2) - l 11,0(9) - cal 0,1(11) - st 0,0(9) - lbz 9,0(11) - rlinm 0,9,0,0xff - mr 9,0 - st 9,56(31) - cmpi 1,9,0 - bc 12,6,$+8 - b L..37 - b L..36 -L..37: - l 0,56(31) - cmpi 1,0,47 - bc 12,5,$+8 - b L..38 - l 0,56(31) - cmpi 1,0,55 - bc 4,5,$+8 - b L..38 - l 0,60(31) - mr 9,0 - sli 0,9,3 - ai 9,0,-48 - l 0,56(31) - cax 9,9,0 - st 9,60(31) - b L..39 -L..38: - b L..36 -L..39: - b L..35 -L..36: - l 0,56(31) - cmpi 1,0,0 - bc 4,6,$+8 - b L..40 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 0,0(11) - ai 11,0,-1 - mr 0,11 - st 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 4,6,$+8 - b L..40 -L..40: - l 9,LC..10(2) - l 0,60(31) - st 0,0(9) - l 9,LC..9(2) - lil 0,48 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..41 -L..34: - l 0,56(31) - cmpi 1,0,39 - bc 12,6,$+8 - b L..42 - lil 0,0 - st 0,60(31) -L..43: - l 9,LC..8(2) - l 11,0(9) - cal 0,1(11) - st 0,0(9) - lbz 9,0(11) - rlinm 0,9,0,0xff - mr 9,0 - st 9,56(31) - cmpi 1,9,0 - bc 12,6,$+8 - b L..45 - b L..44 -L..45: - l 0,56(31) - cmpi 1,0,39 - bc 4,6,$+8 - b L..46 - l 0,56(31) - cmpi 1,0,127 - bc 4,5,$+8 - b L..46 - l 0,60(31) - mr 9,0 - sli 0,9,8 - l 9,56(31) - cax 0,0,9 - st 0,60(31) - b L..47 -L..46: - l 0,56(31) - cmpi 1,0,127 - bc 12,5,$+8 - b L..48 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,0 - bc 4,6,$+8 - b L..48 - l 0,60(31) - mr 9,0 - sli 0,9,16 - l 9,56(31) - mr 11,9 - sli 9,11,8 - cax 0,0,9 - l 9,LC..8(2) - l 11,0(9) - cal 10,1(11) - st 10,0(9) - lbz 11,0(11) - rlinm 9,11,0,0xff - cax 0,0,9 - st 0,60(31) - b L..49 -L..48: - b L..44 -L..49: -L..47: - b L..43 -L..44: - l 0,56(31) - cmpi 1,0,0 - bc 4,6,$+8 - b L..50 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 0,0(11) - ai 11,0,-1 - mr 0,11 - st 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 4,6,$+8 - b L..50 -L..50: - l 9,LC..10(2) - l 0,60(31) - st 0,0(9) - l 9,LC..9(2) - lil 0,48 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..51 -L..42: - l 0,56(31) - cmpi 1,0,96 - bc 12,5,$+8 - b L..54 - l 0,56(31) - cmpi 1,0,122 - bc 12,5,$+8 - b L..53 - b L..54 -L..54: - l 0,56(31) - cmpi 1,0,64 - bc 12,5,$+8 - b L..52 - l 0,56(31) - cmpi 1,0,90 - bc 12,5,$+8 - b L..53 - b L..52 -L..53: - l 9,LC..10(2) - l 0,56(31) - cmpi 1,0,90 - bc 12,5,$+8 - b L..55 - l 11,56(31) - cal 0,-71(11) - b L..56 -L..55: - l 11,56(31) - cal 0,-65(11) -L..56: - st 0,0(9) - l 9,LC..9(2) - lil 0,118 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..57 -L..52: - l 0,56(31) - cmpi 1,0,61 - bc 12,6,$+8 - b L..58 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,61 - bc 12,6,$+8 - b L..58 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 10,0(11) - cal 0,1(10) - mr 11,0 - st 11,0(9) - l 9,LC..9(2) - lil 0,317 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..59 -L..58: - l 0,56(31) - cmpi 1,0,33 - bc 12,6,$+8 - b L..60 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,61 - bc 12,6,$+8 - b L..60 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 10,0(11) - cal 0,1(10) - mr 11,0 - st 11,0(9) - l 9,LC..9(2) - lil 0,289 - st 0,0(9) - b L..61 -L..60: - l 0,56(31) - cmpi 1,0,60 - bc 12,6,$+8 - b L..62 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,60 - bc 12,6,$+8 - b L..62 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 10,0(11) - cal 0,1(10) - mr 11,0 - st 11,0(9) - l 9,LC..9(2) - lil 0,316 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..63 -L..62: - l 0,56(31) - cmpi 1,0,62 - bc 12,6,$+8 - b L..64 - l 11,LC..8(2) - l 9,0(11) - lbz 11,0(9) - rlinm 0,11,0,0xff - cmpi 1,0,62 - bc 12,6,$+8 - b L..64 - l 0,LC..8(2) - l 9,LC..8(2) - l 11,LC..8(2) - l 10,0(11) - cal 0,1(10) - mr 11,0 - st 11,0(9) - l 9,LC..9(2) - lil 0,318 - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - b L..65 -L..64: - l 9,LC..9(2) - l 0,56(31) - st 0,0(9) - l 9,LC..9(2) - l 3,0(9) - b L..6 - l 3,56(31) - b L..6 -L..65: -L..63: -L..61: -L..59: -L..57: -L..51: -L..41: -L..33: -L..21: -L..6: - l 1,0(1) - l 0,8(1) - mtlr 0 - l 31,-4(1) - br -LT..token: - .long 0 - .byte 0,0,32,97,128,1,0,1 - .long LT..token-.token - .short 5 - .byte "token" - .byte 31 - .extern aexpr[DS] - .extern .aexpr -.csect _calc.rw_c[RO] - .align 2 -LC..13: - .byte "? expression not terminated with :" - .byte 0 - .align 2 -LC..16: - .byte "Bad assignment" - .byte 0 - .align 2 -LC..18: - .byte "Bad expression" - .byte 0 -.toc -LC..11: - .tc lvalue[TC],lvalue -LC..12: - .tc last_token[TC],last_token -LC..14: - .tc LC..13[TC],LC..13 -LC..15: - .tc variable[TC],variable -LC..17: - .tc LC..16[TC],LC..16 -LC..19: - .tc LC..18[TC],LC..18 -.csect .text[PR] - .align 2 - .globl expr - .globl .expr -.csect expr[DS] -expr: - .long .expr, TOC[tc0], 0 -.csect .text[PR] -.expr: - mflr 0 - st 31,-4(1) - st 0,8(1) - stu 1,-80(1) - mr 31,1 - bl .aexpr - cror 31,31,31 - mr 0,3 - st 0,56(31) - l 9,LC..11(2) - l 0,0(9) - st 0,60(31) -L..67: - l 9,LC..12(2) - l 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 12,6,$+8 - b L..69 - b L..68 -L..69: - l 9,LC..12(2) - l 0,0(9) - cmpi 1,0,62 - bc 4,6,$+8 - b L..72 - cmpi 1,0,62 - bc 4,5,$+8 - b L..88 - cmpi 1,0,58 - bc 4,6,$+8 - b L..84 - cmpi 1,0,58 - bc 4,5,$+8 - b L..89 - cmpi 1,0,41 - bc 4,6,$+8 - b L..85 - b L..86 -L..89: - cmpi 1,0,60 - bc 4,6,$+8 - b L..71 - cmpi 1,0,61 - bc 4,6,$+8 - b L..81 - b L..86 -L..88: - cmpi 1,0,316 - bc 4,6,$+8 - b L..75 - cmpi 1,0,316 - bc 4,5,$+8 - b L..90 - cmpi 1,0,63 - bc 4,6,$+8 - b L..77 - cmpi 1,0,289 - bc 4,6,$+8 - b L..74 - b L..86 -L..90: - cmpi 1,0,317 - bc 4,6,$+8 - b L..73 - cmpi 1,0,318 - bc 4,6,$+8 - b L..76 - b L..86 -L..71: - bl .aexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - cmp 1,9,0 - mfcr 0 - rlinm 0,0,5,1 - st 0,56(31) - b L..70 -L..72: - bl .aexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - cmp 1,9,0 - mfcr 0 - rlinm 0,0,6,1 - st 0,56(31) - b L..70 -L..73: - bl .aexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - cmp 1,9,0 - mfcr 0 - rlinm 0,0,7,1 - st 0,56(31) - b L..70 -L..74: - bl .aexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - xor 0,9,0 - abs 9,0 - neg 0,9 - sri 0,0,31 - st 0,56(31) - b L..70 -L..75: - bl .aexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - sle 0,9,0 - st 0,56(31) - b L..70 -L..76: - bl .aexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - srea 0,9,0 - st 0,56(31) - b L..70 -L..77: - bl .expr - mr 0,3 - st 0,64(31) - l 9,LC..12(2) - l 0,0(9) - cmpi 1,0,58 - bc 4,6,$+8 - b L..78 - l 3,LC..14(2) - bl .error - cror 31,31,31 - l 3,64(31) - b L..66 -L..78: - l 0,56(31) - cmpi 1,0,0 - bc 4,6,$+8 - b L..79 - bl .expr - l 3,64(31) - b L..66 - b L..80 -L..79: - bl .expr - mr 0,3 - mr 3,0 - b L..66 -L..80: - b L..70 -L..81: - l 0,60(31) - cmpi 1,0,0 - bc 4,4,$+8 - b L..82 - bl .expr - mr 0,3 - st 0,56(31) - l 0,60(31) - mr 9,0 - sli 0,9,2 - l 9,LC..15(2) - cax 0,0,9 - mr 9,0 - l 0,56(31) - st 0,0(9) - l 3,56(31) - b L..66 - b L..83 -L..82: - l 3,LC..17(2) - bl .error - cror 31,31,31 - lil 3,0 - b L..66 -L..83: - b L..70 -L..84: -L..85: - l 3,56(31) - b L..66 -L..86: - l 3,LC..19(2) - bl .error - cror 31,31,31 - bl .token - cror 31,31,31 -L..70: - b L..67 -L..68: - l 9,LC..12(2) - lil 0,-1 - st 0,0(9) - l 3,56(31) - b L..66 -L..66: - l 1,0(1) - l 0,8(1) - mtlr 0 - l 31,-4(1) - br -LT..expr: - .long 0 - .byte 0,0,32,97,128,1,0,1 - .long LT..expr-.expr - .short 4 - .byte "expr" - .byte 31 - .extern mexpr[DS] - .extern .mexpr -.toc -LC..20: - .tc last_token[TC],last_token -.csect .text[PR] - .align 2 - .globl aexpr - .globl .aexpr -.csect aexpr[DS] -aexpr: - .long .aexpr, TOC[tc0], 0 -.csect .text[PR] -.aexpr: - mflr 0 - st 31,-4(1) - st 0,8(1) - stu 1,-72(1) - mr 31,1 - bl .mexpr - cror 31,31,31 - mr 0,3 - st 0,56(31) -L..92: - l 9,LC..20(2) - l 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 12,6,$+8 - b L..94 - b L..93 -L..94: - l 9,LC..20(2) - l 0,0(9) - cmpi 1,0,45 - bc 4,6,$+8 - b L..99 - cmpi 1,0,45 - bc 4,5,$+8 - b L..103 - cmpi 1,0,38 - bc 4,6,$+8 - b L..98 - cmpi 1,0,43 - bc 4,6,$+8 - b L..100 - b L..101 -L..103: - cmpi 1,0,94 - bc 4,6,$+8 - b L..96 - cmpi 1,0,124 - bc 4,6,$+8 - b L..97 - b L..101 -L..96: - bl .mexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - xor 0,9,0 - st 0,56(31) - b L..95 -L..97: - bl .mexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - or 0,9,0 - st 0,56(31) - b L..95 -L..98: - bl .mexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - and 0,9,0 - st 0,56(31) - b L..95 -L..99: - bl .mexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - sf 0,0,9 - st 0,56(31) - b L..95 -L..100: - bl .mexpr - cror 31,31,31 - mr 0,3 - l 9,56(31) - cax 0,9,0 - st 0,56(31) - b L..95 -L..101: - l 3,56(31) - b L..91 -L..95: - b L..92 -L..93: - l 3,56(31) - b L..91 -L..91: - l 1,0(1) - l 0,8(1) - mtlr 0 - l 31,-4(1) - br -LT..aexpr: - .long 0 - .byte 0,0,32,97,128,1,0,1 - .long LT..aexpr-.aexpr - .short 5 - .byte "aexpr" - .byte 31 - .extern term[DS] - .extern .term -.toc -LC..21: - .tc last_token[TC],last_token -.csect .text[PR] - .align 2 - .globl mexpr - .globl .mexpr -.csect mexpr[DS] -mexpr: - .long .mexpr, TOC[tc0], 0 -.csect .text[PR] -.mexpr: - mflr 0 - st 31,-4(1) - st 0,8(1) - stu 1,-72(1) - mr 31,1 - bl .term - cror 31,31,31 - mr 0,3 - st 0,56(31) -L..105: - l 9,LC..21(2) - l 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 12,6,$+8 - b L..107 - b L..106 -L..107: - l 9,LC..21(2) - l 0,0(9) - cmpi 1,0,42 - bc 4,6,$+8 - b L..109 - cmpi 1,0,42 - bc 4,5,$+8 - b L..115 - cmpi 1,0,37 - bc 4,6,$+8 - b L..111 - b L..113 -L..115: - cmpi 1,0,47 - bc 4,6,$+8 - b L..110 - cmpi 1,0,94 - bc 4,6,$+8 - b L..112 - b L..113 -L..109: - bl .mexpr - mr 0,3 - l 9,56(31) - muls 0,9,0 - st 0,56(31) - b L..108 -L..110: - bl .mexpr - mr 0,3 - l 9,56(31) - divs 0,9,0 - mfmq 11 - st 11,60(31) - st 0,56(31) - b L..108 -L..111: - bl .mexpr - mr 0,3 - l 9,56(31) - divs 0,9,0 - mfmq 11 - st 11,60(31) - l 11,60(31) - st 11,56(31) - b L..108 -L..112: - bl .mexpr - mr 0,3 - l 9,56(31) - xor 0,9,0 - st 0,56(31) - b L..108 -L..113: - l 3,56(31) - b L..104 -L..108: - b L..105 -L..106: - l 3,56(31) - b L..104 -L..104: - l 1,0(1) - l 0,8(1) - mtlr 0 - l 31,-4(1) - br -LT..mexpr: - .long 0 - .byte 0,0,32,97,128,1,0,1 - .long LT..mexpr-.mexpr - .short 5 - .byte "mexpr" - .byte 31 -.csect _calc.rw_c[RO] - .align 2 -LC..24: - .byte "Term expected" - .byte 0 - .align 2 -LC..28: - .byte "Unbalanced parenthsis" - .byte 0 - .align 2 -LC..30: - .byte "Unknown term" - .byte 0 -.toc -LC..22: - .tc lvalue[TC],lvalue -LC..23: - .tc last_token[TC],last_token -LC..25: - .tc LC..24[TC],LC..24 -LC..26: - .tc value[TC],value -LC..27: - .tc variable[TC],variable -LC..29: - .tc LC..28[TC],LC..28 -LC..31: - .tc LC..30[TC],LC..30 -.csect .text[PR] - .align 2 - .globl term - .globl .term -.csect term[DS] -term: - .long .term, TOC[tc0], 0 -.csect .text[PR] -.term: - mflr 0 - st 31,-4(1) - st 0,8(1) - stu 1,-72(1) - mr 31,1 - l 9,LC..22(2) - lil 0,-1 - st 0,0(9) - bl .token - cror 31,31,31 - l 9,LC..23(2) - l 0,0(9) - lil 9,-1 - cmp 1,0,9 - bc 12,6,$+8 - b L..117 - l 3,LC..25(2) - bl .error - cror 31,31,31 -L..117: - l 9,LC..23(2) - l 0,0(9) - cmpi 1,0,48 - bc 4,6,$+8 - b L..119 - cmpi 1,0,48 - bc 4,5,$+8 - b L..127 - cmpi 1,0,40 - bc 4,6,$+8 - b L..123 - cmpi 1,0,40 - bc 4,5,$+8 - b L..128 - cmpi 1,0,33 - bc 4,6,$+8 - b L..122 - b L..125 -L..128: - cmpi 1,0,45 - bc 4,6,$+8 - b L..121 - b L..125 -L..127: - cmpi 1,0,118 - bc 4,6,$+8 - b L..120 - b L..125 -L..119: - l 9,LC..26(2) - l 0,0(9) - st 0,56(31) - bl .token - cror 31,31,31 - l 3,56(31) - b L..116 -L..120: - l 9,LC..22(2) - l 11,LC..26(2) - l 0,0(11) - st 0,0(9) - st 0,56(31) - bl .token - cror 31,31,31 - l 0,56(31) - mr 9,0 - sli 0,9,2 - l 9,LC..27(2) - cax 0,0,9 - mr 9,0 - l 3,0(9) - b L..116 -L..121: - bl .term - mr 0,3 - neg 9,0 - mr 3,9 - b L..116 -L..122: - bl .term - mr 0,3 - cmpi 1,0,0 - mfcr 0 - rlinm 0,0,7,1 - mr 3,0 - b L..116 -L..123: - bl .expr - cror 31,31,31 - mr 0,3 - st 0,56(31) - l 9,LC..23(2) - l 0,0(9) - cmpi 1,0,41 - bc 4,6,$+8 - b L..124 - l 3,LC..29(2) - bl .error - cror 31,31,31 -L..124: - bl .token - cror 31,31,31 - l 3,56(31) - b L..116 -L..125: - bl .token - cror 31,31,31 - l 3,LC..31(2) - bl .error - cror 31,31,31 - lil 3,0 - b L..116 -L..118: -L..116: - l 1,0(1) - l 0,8(1) - mtlr 0 - l 31,-4(1) - br -LT..term: - .long 0 - .byte 0,0,32,97,128,1,0,1 - .long LT..term-.term - .short 4 - .byte "term" - .byte 31 - .extern .__main - .extern fgets[DS] - .extern .fgets - .extern printf[DS] - .extern .printf -.csect _calc.rw_c[RO] - .align 2 -LC..34: - .byte "%s = 0x%08x = %d" - .byte 10, 0 - .extern fflush[DS] - .extern .fflush -.toc -LC..32: - .tc _iob[TC],_iob[RW] -LC..33: - .tc ptr[TC],ptr -LC..35: - .tc LC..34[TC],LC..34 -LC..36: - .tc _iob.P32[TC],_iob[RW]+32 -.csect .text[PR] - .align 2 - .globl main - .globl .main -.csect main[DS] -main: - .long .main, TOC[tc0], 0 -.csect .text[PR] -.main: - mflr 0 - st 31,-4(1) - st 0,8(1) - stu 1,-4168(1) - mr 31,1 - bl .__main - cror 31,31,31 -L..130: - cal 0,60(31) - mr 3,0 - lil 4,4096 - l 5,LC..32(2) - bl .fgets - cror 31,31,31 - mr 0,3 - cmpi 1,0,0 - bc 12,6,$+8 - b L..132 - b L..131 -L..132: - l 9,LC..33(2) - cal 0,60(31) - st 0,0(9) - bl .expr - cror 31,31,31 - mr 0,3 - st 0,56(31) - cal 0,60(31) - l 3,LC..35(2) - mr 4,0 - l 5,56(31) - l 6,56(31) - bl .printf - cror 31,31,31 - l 3,LC..36(2) - bl .fflush - cror 31,31,31 - b L..130 -L..131: - lil 3,0 - b L..129 -L..129: - l 1,0(1) - l 0,8(1) - mtlr 0 - l 31,-4(1) - br -LT..main: - .long 0 - .byte 0,0,32,97,128,1,0,1 - .long LT..main-.main - .short 4 - .byte "main" - .byte 31 -.comm ptr,4 -.comm last_ptr,4 -.comm value,4 -.comm lvalue,4 -.comm last_token,4 -.comm variable,192 -_section_.text: -.csect .data[RW] - .long _section_.text
--- a/calc.s.rs6k Fri Nov 09 15:36:02 2007 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1181 +0,0 @@ -.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4 -.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9 -.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14 -.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19 -.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24 -.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29 -.set r30,30; .set r31,31 -.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4 -.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9 -.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14 -.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19 -.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24 -.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29 -.set fp30,30; .set fp31,31 -.set MQ,0; .set XER,1; .set FROM_RTCU,4; .set FROM_RTCL,5; .set FROM_DEC,6 -.set LR,8; .set CTR,9; .set TID,17; .set DSISR,18; .set DAR,19; .set TO_RTCU,20 -.set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24; .set SDR_1,25; .set SRR_0,26 -.set SRR_1,27 -.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1 -.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3 -.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6 -.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9 -.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12 -.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16 -.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19 -.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22 -.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25 -.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28 -.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31 -.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3 -.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7 -.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11 -.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15 -.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19 -.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23 -.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27 -.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31 -.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1 - - .rename H.10.NO_SYMBOL{PR},"" - .rename E.30._calc_c_{RW},"_calc$c$" - .rename H.32._calc_c_{TC},"_calc$c$" - .rename H.36.line_skip{TC},"line_skip" - .rename H.40.ptr{TC},"ptr" - .rename H.44.last_ptr{TC},"last_ptr" - .rename H.48.last_token{TC},"last_token" - .rename H.52.error{TC},"error" - .rename H.56._iob{TC},"_iob" - .rename H.60.token{TC},"token" - .rename H.64.value{TC},"value" - .rename H.68.expr{TC},"expr" - .rename H.72.lvalue{TC},"lvalue" - .rename H.76.variable{TC},"variable" - .rename H.80.aexpr{TC},"aexpr" - .rename H.84.mexpr{TC},"mexpr" - .rename H.88.term{TC},"term" - .rename H.92.main{TC},"main" - - .lglobl H.10.NO_SYMBOL{PR} - .globl .line_skip - .globl .error - .globl .token - .globl .expr - .globl .aexpr - .globl .mexpr - .globl .term - .globl .main - .lglobl E.30._calc_c_{RW} - .globl line_skip{DS} - .globl ptr{RW} - .globl last_ptr{RW} - .globl last_token{RW} - .globl error{DS} - .extern _iob{UA} - .globl token{DS} - .globl value{RW} - .globl expr{DS} - .globl lvalue{RW} - .globl variable{RW} - .globl aexpr{DS} - .globl mexpr{DS} - .globl term{DS} - .globl main{DS} - .extern .fprintf{PR} - .extern .fgets{PR} - .extern .printf{PR} - .extern .fflush{PR} - - -# .text section - - - .csect H.10.NO_SYMBOL{PR} -.line_skip: # 0x00000000 (H.10.NO_SYMBOL) - .file "calc.c" - l r4,T.40.ptr(RTOC) - cal r0,-1(r0) - l r3,0(r4) - l r5,T.44.last_ptr(RTOC) - lbz r6,0(r3) - cal r8,0(r3) - cmpi 0,r6,0 - ai r3,r3,1 - st r3,0(r4) - l r6,T.48.last_token(RTOC) - bc BO_IF,CR0_EQ,__L54 - lbzu r7,1(r8) - ai r3,r3,1 - cmpi 1,r7,0 - st r3,0(r4) -__L3c: # 0x0000003c (H.10.NO_SYMBOL+0x3c) - bc BO_IF,CR1_VX,__L54 - lbzu r7,1(r8) - ai r3,r3,1 - cmpi 1,r7,0 - st r3,0(r4) - b __L3c -__L54: # 0x00000054 (H.10.NO_SYMBOL+0x54) - st r3,0(r5) - st r0,0(r6) - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x40 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=0 - .byte 0x00 # STORES_BC=0,FPR_SAVED=0 - .byte 0x00 # GPR_SAVED=0 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x00000060 # TB_OFFSET - .short 9 # NAME_LEN - .byte "line_skip" - .byte 0 # padding -# End of traceback table -.error: # 0x0000007c (H.10.NO_SYMBOL+0x7c) - cal r5,0(r3) - l r4,T.44.last_ptr(RTOC) - mfspr r0,LR - stu SP,-64(SP) - l r3,T.56._iob(RTOC) - l r6,0(r4) - st r0,72(SP) - ai r3,r3,64 - l r4,T.32._calc_c_(RTOC) - bl .fprintf{PR} - cror CR3_SO,CR3_SO,CR3_SO - bl .line_skip - l r12,72(SP) - ai SP,SP,64 - mtspr LR,r12 - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x00 # GPR_SAVED=0 - .byte 0x01 # FIXEDPARMS=1 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x00000000 # - .long 0x00000040 # TB_OFFSET - .short 5 # NAME_LEN - .byte "error" - .byte 0 # padding -# End of traceback table -.token: # 0x000000d8 (H.10.NO_SYMBOL+0xd8) - l r6,T.40.ptr(RTOC) - l r4,T.44.last_ptr(RTOC) - l r5,0(r6) - mfspr r0,LR - st r5,0(r4) - lbz r3,0(r5) - stu SP,-64(SP) - cmpi 0,r3,32 - cmpi 1,r3,0 - st r0,72(SP) - ai r4,r5,1 - bc BO_IF,CR0_GT,__L150 - bc BO_IF,CR1_VX,__L158 - ai r7,r5,2 - cal r5,0(r4) - st r5,0(r6) - lbz r3,0(r4) - ai r4,r7,1 - cmpi 0,r3,32 - cmpi 1,r3,0 -__L128: # 0x00000128 (H.10.NO_SYMBOL+0x128) - bc BO_IF,CR0_GT,__L150 - bc BO_IF,CR1_VX,__L158 - ai r5,r5,1 - st r5,0(r6) - lbz r3,0(r7) - cal r7,0(r4) - cmpi 0,r3,32 - cmpi 1,r3,0 - ai r4,r4,1 - b __L128 -__L150: # 0x00000150 (H.10.NO_SYMBOL+0x150) - cmpi 1,r3,0 - bc BO_IF_NOT,CR1_VX,__L16c -__L158: # 0x00000158 (H.10.NO_SYMBOL+0x158) - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - cal r3,-1(r0) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L16c: # 0x0000016c (H.10.NO_SYMBOL+0x16c) - cmpi 0,r3,47 - ai r4,r5,1 - st r4,0(r6) - bc BO_IF_NOT,CR0_EQ,__L1a8 - lbz r4,1(r5) - cmpli 1,r4,0x002f - cmpli 0,r4,0x002a - bc BO_IF,CR1_VX,__L190 - bc BO_IF_NOT,CR0_EQ,__L1a8 -__L190: # 0x00000190 (H.10.NO_SYMBOL+0x190) - bl .line_skip - cal r3,-1(r0) - l r12,72(SP) - ai SP,SP,64 - mtspr LR,r12 - bcr BO_ALWAYS,CR0_LT -__L1a8: # 0x000001a8 (H.10.NO_SYMBOL+0x1a8) - cmpi 1,r3,49 - cmpi 0,r3,57 - cmpi 7,r3,48 - cmpi 6,r3,39 - ai r8,r3,-48 - bc BO_IF,CR1_FX,__L258 - bc BO_IF,CR0_GT,__L258 - lbz r3,1(r5) - ai r4,r5,1 - cmpi 0,r3,0 - ai r5,r5,2 - st r5,0(r6) - bc BO_IF,CR0_EQ,__L22c - rlinm r0,r8,3,0,28 - cmpi 1,r3,48 - cmpi 0,r3,57 - ai r7,r3,-48 - a r0,r8,r0 -__L1f0: # 0x000001f0 (H.10.NO_SYMBOL+0x1f0) - bc BO_IF,CR1_FX,__L22c - a r0,r8,r0 - bc BO_IF,CR0_GT,__L22c - lbzu r3,1(r4) - ai r5,r5,1 - cmpi 6,r3,0 - a r8,r7,r0 - st r5,0(r6) - ai r7,r3,-48 - bc BO_IF,CR6_EQ,__L22c - rlinm r0,r8,3,0,28 - cmpi 1,r3,48 - cmpi 0,r3,57 - a r0,r8,r0 - b __L1f0 -__L22c: # 0x0000022c (H.10.NO_SYMBOL+0x22c) - cmpi 0,r3,0 - bc BO_IF,CR0_EQ,__L23c - ai r4,r5,-1 - st r4,0(r6) -__L23c: # 0x0000023c (H.10.NO_SYMBOL+0x23c) - l r3,T.64.value(RTOC) - ai SP,SP,64 - l r4,T.48.last_token(RTOC) -__L248: # 0x00000248 (H.10.NO_SYMBOL+0x248) - st r8,0(r3) - cal r3,48(r0) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L258: # 0x00000258 (H.10.NO_SYMBOL+0x258) - cmpi 0,r3,97 - bc BO_IF_NOT,CR7_EQ,__L3c8 - lbz r4,1(r5) - cal r0,0(r8) - cmpli 1,r4,0x0078 - bc BO_IF_NOT,CR1_VX,__L344 - ai r4,r5,2 - st r4,0(r6) - lbz r3,2(r5) - ai r0,r5,3 - cmpi 0,r3,0 - st r0,0(r6) - cal r8,0(r0) - bc BO_IF,CR0_EQ,__L324 - cmpi 6,r3,48 - cmpi 0,r3,57 - cmpi 1,r3,97 - cmpi 7,r3,102 -__L2a0: # 0x000002a0 (H.10.NO_SYMBOL+0x2a0) - rlinm r5,r8,4,0,27 - cror CR0_EQ,CR6_LT,CR0_GT - bc BO_IF,CR0_EQ,__L2c4 - ai r3,r3,-48 - a r8,r3,r5 - lbzu r3,1(r4) - ai r0,r0,1 - cmpi 0,r3,0 - b __L308 -__L2c4: # 0x000002c4 (H.10.NO_SYMBOL+0x2c4) - cmpi 0,r3,65 - cmpi 6,r3,70 - cror CR1_VX,CR1_FX,CR7_GT - bc BO_IF,CR1_VX,__L2ec - ai r3,r3,-87 - a r8,r5,r3 - lbzu r3,1(r4) - ai r0,r0,1 - cmpi 0,r3,0 - b __L308 -__L2ec: # 0x000002ec (H.10.NO_SYMBOL+0x2ec) - ai r7,r3,-87 - bc BO_IF,CR0_LT,__L324 - bc BO_IF,CR6_GT,__L324 - a r8,r5,r7 - lbzu r3,1(r4) - ai r0,r0,1 - cmpi 0,r3,0 -__L308: # 0x00000308 (H.10.NO_SYMBOL+0x308) - st r0,0(r6) - bc BO_IF,CR0_EQ,__L324 - cmpi 6,r3,48 - cmpi 0,r3,57 - cmpi 1,r3,97 - cmpi 7,r3,102 - b __L2a0 -__L324: # 0x00000324 (H.10.NO_SYMBOL+0x324) - cmpi 1,r3,0 - bc BO_IF,CR1_VX,__L23c - ai r4,r0,-1 - st r4,0(r6) - l r3,T.64.value(RTOC) - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - b __L248 -__L344: # 0x00000344 (H.10.NO_SYMBOL+0x344) - cmpi 0,r4,0 - ai r3,r5,1 - ai r5,r5,2 - st r5,0(r6) - bc BO_IF,CR0_EQ,__L39c - cmpi 6,r4,48 - cmpi 0,r4,55 - ai r8,r4,-48 - rlinm r7,r0,3,0,28 -__L368: # 0x00000368 (H.10.NO_SYMBOL+0x368) - bc BO_IF,CR6_LT,__L39c - bc BO_IF,CR0_GT,__L39c - lbzu r4,1(r3) - ai r5,r5,1 - cmpi 1,r4,0 - a r0,r8,r7 - st r5,0(r6) - ai r8,r4,-48 - bc BO_IF,CR1_VX,__L39c - cmpi 6,r4,48 - cmpi 0,r4,55 - rlinm r7,r0,3,0,28 - b __L368 -__L39c: # 0x0000039c (H.10.NO_SYMBOL+0x39c) - cmpi 0,r4,0 - bc BO_IF,CR0_EQ,__L3ac - ai r4,r5,-1 - st r4,0(r6) -__L3ac: # 0x000003ac (H.10.NO_SYMBOL+0x3ac) - l r3,T.64.value(RTOC) - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - st r0,0(r3) - cal r3,48(r0) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L3c8: # 0x000003c8 (H.10.NO_SYMBOL+0x3c8) - cmpi 1,r3,122 - cal r4,0(r0) - bc BO_IF_NOT,CR6_EQ,__L490 - lbz r0,1(r5) - ai r3,r5,2 - cmpi 0,r0,0 - st r3,0(r6) - bc BO_IF,CR0_EQ,__L464 - cmpi 1,r0,39 - cmpi 6,r0,127 - cmpi 0,r0,128 - rlinm r5,r4,8,0,23 -__L3f8: # 0x000003f8 (H.10.NO_SYMBOL+0x3f8) - cror CR1_VX,CR1_VX,CR6_GT - rlinm r7,r4,16,0,15 - bc BO_IF,CR1_VX,__L418 - a r4,r0,r5 - lbz r0,0(r3) - ai r3,r3,1 - cmpi 0,r0,0 - b __L448 -__L418: # 0x00000418 (H.10.NO_SYMBOL+0x418) - rlinm r5,r0,8,0,23 - a r7,r7,r5 - bc BO_IF,CR0_LT,__L464 - lbz r5,0(r3) - cmpi 1,r5,0 - bc BO_IF,CR1_VX,__L464 - ai r3,r3,1 - a r4,r5,r7 - st r3,0(r6) - lbz r0,0(r3) - ai r3,r3,1 - cmpi 0,r0,0 -__L448: # 0x00000448 (H.10.NO_SYMBOL+0x448) - cmpi 1,r0,39 - cmpi 6,r0,127 - st r3,0(r6) - bc BO_IF,CR0_EQ,__L464 - cmpi 0,r0,128 - rlinm r5,r4,8,0,23 - b __L3f8 -__L464: # 0x00000464 (H.10.NO_SYMBOL+0x464) - cmpi 0,r0,0 - bc BO_IF,CR0_EQ,__L474 - ai r3,r3,-1 - st r3,0(r6) -__L474: # 0x00000474 (H.10.NO_SYMBOL+0x474) - l r3,T.64.value(RTOC) - ai SP,SP,64 - l r5,T.48.last_token(RTOC) - st r4,0(r3) - cal r3,48(r0) - st r3,0(r5) - bcr BO_ALWAYS,CR0_LT -__L490: # 0x00000490 (H.10.NO_SYMBOL+0x490) - cmpi 6,r3,65 - cmpi 7,r3,90 - bc BO_IF,CR0_LT,__L4a0 - bc BO_IF_NOT,CR1_FEX,__L4b0 -__L4a0: # 0x000004a0 (H.10.NO_SYMBOL+0x4a0) - cmpi 1,r3,61 - cmpi 0,r3,33 - cror CR6_EQ,CR6_LT,CR7_GT - bc BO_IF,CR6_EQ,__L4dc -__L4b0: # 0x000004b0 (H.10.NO_SYMBOL+0x4b0) - bc BO_IF_NOT,CR7_GT,__L4bc - ai r5,r3,-71 - b __L4c0 -__L4bc: # 0x000004bc (H.10.NO_SYMBOL+0x4bc) - ai r5,r3,-65 -__L4c0: # 0x000004c0 (H.10.NO_SYMBOL+0x4c0) - l r3,T.64.value(RTOC) - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - st r5,0(r3) - cal r3,118(r0) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L4dc: # 0x000004dc (H.10.NO_SYMBOL+0x4dc) - cmpi 6,r3,60 - bc BO_IF_NOT,CR1_VX,__L50c - lbz r0,1(r5) - ai r4,r5,2 - cmpli 1,r0,0x003d - bc BO_IF_NOT,CR1_VX,__L50c - st r4,0(r6) - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - cal r3,317(r0) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L50c: # 0x0000050c (H.10.NO_SYMBOL+0x50c) - cmpi 1,r3,62 - bc BO_IF_NOT,CR0_EQ,__L53c - lbz r4,1(r5) - ai r0,r5,2 - cmpli 0,r4,0x003d - bc BO_IF_NOT,CR0_EQ,__L53c - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - cal r3,289(r0) - st r0,0(r6) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L53c: # 0x0000053c (H.10.NO_SYMBOL+0x53c) - bc BO_IF_NOT,CR6_EQ,__L568 - lbz r0,1(r5) - ai r4,r5,2 - cmpli 0,r0,0x003c - bc BO_IF_NOT,CR0_EQ,__L568 - st r4,0(r6) - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - cal r3,316(r0) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L568: # 0x00000568 (H.10.NO_SYMBOL+0x568) - bc BO_IF_NOT,CR1_VX,__L594 - lbz r4,1(r5) - ai r5,r5,2 - cmpli 0,r4,0x003e - bc BO_IF_NOT,CR0_EQ,__L594 - ai SP,SP,64 - l r4,T.48.last_token(RTOC) - cal r3,318(r0) - st r5,0(r6) - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -__L594: # 0x00000594 (H.10.NO_SYMBOL+0x594) - l r4,T.48.last_token(RTOC) - ai SP,SP,64 - st r3,0(r4) - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x00 # GPR_SAVED=0 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x000004cc # TB_OFFSET - .short 5 # NAME_LEN - .byte "token" - .byte 0 # padding -# End of traceback table -.expr: # 0x000005bc (H.10.NO_SYMBOL+0x5bc) - mfspr r0,LR - stm r27,-20(SP) - mfcr r12 - st r0,8(SP) - l r0,T.32._calc_c_(RTOC) - st r12,4(SP) - stu SP,-96(SP) - l r30,T.72.lvalue(RTOC) - ai r31,r0,64 - l r29,T.48.last_token(RTOC) - bl .aexpr -__L5e8: # 0x000005e8 (H.10.NO_SYMBOL+0x5e8) - l r0,0(r29) - cal r28,0(r3) - cmpi 0,r0,-1 - l r27,0(r30) - bc BO_IF,CR0_EQ,__L7a4 - cmpi 0,r0,289 - cmpi 7,r0,63 - cmpi 1,r0,60 - cmpi 4,r0,41 -__L60c: # 0x0000060c (H.10.NO_SYMBOL+0x60c) - bc BO_IF,CR7_EQ,__L730 - cmpi 3,r0,317 - cmpi 6,r0,61 - cmpi 5,r0,316 - bc BO_IF,CR7_GT,__L6d4 - bc BO_IF,CR1_VX,__L6b4 - cmpi 0,r0,62 - cmpi 7,r0,58 - bc BO_IF,CR1_FEX,__L648 - bc BO_IF,CR4_EQ,__L638 - bc BO_IF_NOT,CR7_EQ,__L778 -__L638: # 0x00000638 (H.10.NO_SYMBOL+0x638) - cal r3,0(r28) - l r0,104(SP) - l r12,100(SP) - b __L7b8 -__L648: # 0x00000648 (H.10.NO_SYMBOL+0x648) - bc BO_IF,CR6_EQ,__L674 - bc BO_IF_NOT,CR0_EQ,__L778 - bl .aexpr - cmp 0,r28,r3 - cal r28,1(r0) - bc BO_IF,CR0_GT,__L784 - cal r28,0(r0) - l r0,0(r29) - cmpi 0,r0,-1 -__L66c: # 0x0000066c (H.10.NO_SYMBOL+0x66c) - bc BO_IF,CR0_EQ,__L7a4 - b __L790 -__L674: # 0x00000674 (H.10.NO_SYMBOL+0x674) - cmpi 0,r27,0 - bc BO_IF,CR0_LT,__L6a0 - bl .expr - l r9,T.76.variable(RTOC) - rlinm r10,r27,2,0,29 - stx r3,r9,r10 - l r0,104(SP) - l r12,100(SP) - ai SP,SP,96 - mtcrf 24,r12 - b __L7c0 -__L6a0: # 0x000006a0 (H.10.NO_SYMBOL+0x6a0) - l r0,T.32._calc_c_(RTOC) - ai r3,r0,48 - bl .error - cal r3,0(r0) - b __L7b0 -__L6b4: # 0x000006b4 (H.10.NO_SYMBOL+0x6b4) - bl .aexpr - cmp 0,r28,r3 - cal r28,1(r0) - bc BO_IF,CR0_LT,__L784 - cal r28,0(r0) - l r0,0(r29) - cmpi 0,r0,-1 - b __L66c -__L6d4: # 0x000006d4 (H.10.NO_SYMBOL+0x6d4) - cmpi 1,r0,318 - bc BO_IF,CR0_EQ,__L718 - bc BO_IF,CR5_EQ,__L70c - bc BO_IF,CR3_EQ,__L6f8 - bc BO_IF_NOT,CR1_VX,__L778 - bl .aexpr - sra r28,r28,r3 - l r0,0(r29) - b __L788 -__L6f8: # 0x000006f8 (H.10.NO_SYMBOL+0x6f8) - bl .aexpr - sf r0,r3,r28 - cntlz r0,r0 - rlinm r28,r0,27,5,31 - b __L784 -__L70c: # 0x0000070c (H.10.NO_SYMBOL+0x70c) - bl .aexpr - sl r28,r28,r3 - b __L784 -__L718: # 0x00000718 (H.10.NO_SYMBOL+0x718) - bl .aexpr - sf r0,r3,r28 - cntlz r0,r0 - ai r0,r0,-32 - rlinm r28,r0,1,31,31 - b __L784 -__L730: # 0x00000730 (H.10.NO_SYMBOL+0x730) - bl .expr - l r0,0(r29) - cmpi 0,r28,0 - cmpi 1,r0,58 - st r3,56(SP) - bc BO_IF,CR1_VX,__L760 - l r0,T.32._calc_c_(RTOC) - ai r3,r0,12 - bl .error - l r3,56(SP) - l r0,104(SP) - b __L7b4 -__L760: # 0x00000760 (H.10.NO_SYMBOL+0x760) - bc BO_IF_NOT,CR0_EQ,__L76c - bl .aexpr - b __L5e8 -__L76c: # 0x0000076c (H.10.NO_SYMBOL+0x76c) - bl .expr - l r3,56(SP) - b __L7b0 -__L778: # 0x00000778 (H.10.NO_SYMBOL+0x778) - cal r3,0(r31) - bl .error - bl .token -__L784: # 0x00000784 (H.10.NO_SYMBOL+0x784) - l r0,0(r29) -__L788: # 0x00000788 (H.10.NO_SYMBOL+0x788) - cmpi 0,r0,-1 - bc BO_IF,CR0_EQ,__L7a4 -__L790: # 0x00000790 (H.10.NO_SYMBOL+0x790) - cmpi 0,r0,289 - cmpi 7,r0,63 - cmpi 1,r0,60 - cmpi 4,r0,41 - b __L60c -__L7a4: # 0x000007a4 (H.10.NO_SYMBOL+0x7a4) - cal r0,-1(r0) - cal r3,0(r28) - st r0,0(r29) -__L7b0: # 0x000007b0 (H.10.NO_SYMBOL+0x7b0) - l r0,104(SP) -__L7b4: # 0x000007b4 (H.10.NO_SYMBOL+0x7b4) - l r12,100(SP) -__L7b8: # 0x000007b8 (H.10.NO_SYMBOL+0x7b8) - ai SP,SP,96 - mtcrf 24,r12 -__L7c0: # 0x000007c0 (H.10.NO_SYMBOL+0x7c0) - mtspr LR,r0 - lm r27,-20(SP) - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x43 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=1,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x05 # GPR_SAVED=5 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x00000210 # TB_OFFSET - .short 4 # NAME_LEN - .byte "expr" - .byte 0 # padding - .byte 0 # padding -# End of traceback table -.aexpr: # 0x000007e4 (H.10.NO_SYMBOL+0x7e4) - mfspr r0,LR - stm r30,-8(SP) - st r0,8(SP) - stu SP,-80(SP) - bl .mexpr - l r31,T.48.last_token(RTOC) - cal r30,0(r3) - l r0,0(r31) - cmpi 0,r0,-1 - bc BO_IF,CR0_EQ,__L86c - cmpi 5,r0,45 - cmpi 6,r0,38 - cmpi 0,r0,94 -__L818: # 0x00000818 (H.10.NO_SYMBOL+0x818) - bc BO_IF,CR5_EQ,__L890 - cmpi 1,r0,124 - cmpi 7,r0,43 - bc BO_IF,CR5_GT,__L850 - bc BO_IF,CR6_EQ,__L844 - bc BO_IF_NOT,CR7_EQ,__L86c - bl .mexpr - a r30,r30,r3 - l r0,0(r31) - cmpi 0,r0,-1 - b __L8a0 -__L844: # 0x00000844 (H.10.NO_SYMBOL+0x844) - bl .mexpr - and r30,r30,r3 - b __L898 -__L850: # 0x00000850 (H.10.NO_SYMBOL+0x850) - bc BO_IF,CR0_EQ,__L884 - bc BO_IF_NOT,CR1_VX,__L86c - bl .mexpr - or r30,r30,r3 - l r0,0(r31) - cmpi 0,r0,-1 - bc BO_IF_NOT,CR0_EQ,__L8a4 -__L86c: # 0x0000086c (H.10.NO_SYMBOL+0x86c) - cal r3,0(r30) - l r12,88(SP) - ai SP,SP,80 - mtspr LR,r12 - lm r30,-8(SP) - bcr BO_ALWAYS,CR0_LT -__L884: # 0x00000884 (H.10.NO_SYMBOL+0x884) - bl .mexpr - xor r30,r3,r30 - b __L898 -__L890: # 0x00000890 (H.10.NO_SYMBOL+0x890) - bl .mexpr - sf r30,r3,r30 -__L898: # 0x00000898 (H.10.NO_SYMBOL+0x898) - l r0,0(r31) - cmpi 0,r0,-1 -__L8a0: # 0x000008a0 (H.10.NO_SYMBOL+0x8a0) - bc BO_IF,CR0_EQ,__L86c -__L8a4: # 0x000008a4 (H.10.NO_SYMBOL+0x8a4) - cmpi 5,r0,45 - cmpi 6,r0,38 - cmpi 0,r0,94 - b __L818 -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x02 # GPR_SAVED=2 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x000000d0 # TB_OFFSET - .short 5 # NAME_LEN - .byte "aexpr" - .byte 0 # padding -# End of traceback table -.mexpr: # 0x000008cc (H.10.NO_SYMBOL+0x8cc) - mfspr r0,LR - stm r30,-8(SP) - st r0,8(SP) - stu SP,-80(SP) - bl .term - l r31,T.48.last_token(RTOC) - cal r30,0(r3) - l r0,0(r31) - cmpi 0,r0,-1 - bc BO_IF,CR0_EQ,__L940 - cmpi 7,r0,37 - cmpi 1,r0,94 - cmpi 0,r0,42 - cmpi 6,r0,47 - bc BO_IF,CR7_EQ,__L970 -__L908: # 0x00000908 (H.10.NO_SYMBOL+0x908) - bc BO_IF,CR0_EQ,__L964 - bc BO_IF,CR6_EQ,__L958 - bc BO_IF_NOT,CR1_VX,__L940 - bl .mexpr - xor r30,r30,r3 -__L91c: # 0x0000091c (H.10.NO_SYMBOL+0x91c) - l r0,0(r31) - cmpi 0,r0,-1 - bc BO_IF,CR0_EQ,__L940 - cmpi 7,r0,37 - cmpi 1,r0,94 - cmpi 0,r0,42 - cmpi 6,r0,47 - bc BO_IF,CR7_EQ,__L970 - b __L908 -__L940: # 0x00000940 (H.10.NO_SYMBOL+0x940) - cal r3,0(r30) - l r12,88(SP) - ai SP,SP,80 - mtspr LR,r12 - lm r30,-8(SP) - bcr BO_ALWAYS,CR0_LT -__L958: # 0x00000958 (H.10.NO_SYMBOL+0x958) - bl .mexpr - divs r30,r30,r3 - b __L91c -__L964: # 0x00000964 (H.10.NO_SYMBOL+0x964) - bl .mexpr - muls r30,r3,r30 - b __L91c -__L970: # 0x00000970 (H.10.NO_SYMBOL+0x970) - bl .mexpr - divs r0,r30,r3 - mfspr r30,MQ - b __L91c -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x02 # GPR_SAVED=2 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x000000b4 # TB_OFFSET - .short 5 # NAME_LEN - .byte "mexpr" - .byte 0 # padding -# End of traceback table -.term: # 0x00000998 (H.10.NO_SYMBOL+0x998) - mfspr r0,LR - stm r30,-8(SP) - l r31,T.72.lvalue(RTOC) - st r0,8(SP) - cal r0,-1(r0) - stu SP,-80(SP) - st r0,0(r31) - bl .token - l r30,T.48.last_token(RTOC) - l r3,T.32._calc_c_(RTOC) - l r0,0(r30) - ai r3,r3,80 - cmpi 0,r0,-1 - bc BO_IF_NOT,CR0_EQ,__L9d8 - bl .error - l r0,0(r30) -__L9d8: # 0x000009d8 (H.10.NO_SYMBOL+0x9d8) - cmpi 6,r0,45 - cmpi 0,r0,33 - cmpi 1,r0,48 - bc BO_IF,CR6_EQ,__La40 - cmpi 5,r0,118 - cmpi 7,r0,40 - bc BO_IF,CR6_GT,__La04 - bc BO_IF,CR0_EQ,__La4c - bc BO_IF,CR7_EQ,__La5c - bl .token - b __La84 -__La04: # 0x00000a04 (H.10.NO_SYMBOL+0xa04) - l r3,T.64.value(RTOC) - l r9,0(r3) - bc BO_IF,CR1_VX,__La1c - bc BO_IF,CR5_EQ,__La28 - bl .token - b __La84 -__La1c: # 0x00000a1c (H.10.NO_SYMBOL+0xa1c) - bl .token - cal r3,0(r9) - b __La94 -__La28: # 0x00000a28 (H.10.NO_SYMBOL+0xa28) - st r9,0(r31) - bl .token - l r3,T.76.variable(RTOC) - rlinm r4,r9,2,0,29 - lx r3,r3,r4 - b __La94 -__La40: # 0x00000a40 (H.10.NO_SYMBOL+0xa40) - bl .term - neg r3,r3 - b __La94 -__La4c: # 0x00000a4c (H.10.NO_SYMBOL+0xa4c) - bl .term - cntlz r0,r3 - rlinm r3,r0,27,5,31 - b __La94 -__La5c: # 0x00000a5c (H.10.NO_SYMBOL+0xa5c) - bl .expr - l r0,0(r30) - st r3,56(SP) - cmpi 0,r0,41 - l r0,T.32._calc_c_(RTOC) - ai r3,r0,96 - bcl BO_IF_NOT,CR0_EQ,.error - bl .token - l r3,56(SP) - b __La94 -__La84: # 0x00000a84 (H.10.NO_SYMBOL+0xa84) - l r0,T.32._calc_c_(RTOC) - ai r3,r0,120 - bl .error - cal r3,0(r0) -__La94: # 0x00000a94 (H.10.NO_SYMBOL+0xa94) - l r12,88(SP) - ai SP,SP,80 - mtspr LR,r12 - lm r30,-8(SP) - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x02 # GPR_SAVED=2 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x00000110 # TB_OFFSET - .short 4 # NAME_LEN - .byte "term" - .byte 0 # padding - .byte 0 # padding -# End of traceback table -.main: # 0x00000ac0 (H.10.NO_SYMBOL+0xac0) - mfspr r0,LR - stm r27,-20(SP) - l r30,T.56._iob(RTOC) - st r0,8(SP) - stu SP,-4192(SP) - ai r31,SP,56 - cal r5,0(r30) - cal r3,0(r31) - cal r4,4096(r0) - bl .fgets{PR} - cror CR3_SO,CR3_SO,CR3_SO - cmpi 0,r3,0 - l r0,T.32._calc_c_(RTOC) - l r27,T.40.ptr(RTOC) - ai r28,r0,136 - bc BO_IF,CR0_EQ,__Lb58 - ai r29,r30,32 - st r31,0(r27) - bl .expr -__Lb0c: # 0x00000b0c (H.10.NO_SYMBOL+0xb0c) - cal r6,0(r3) - cal r5,0(r3) - cal r3,0(r28) - ai r4,SP,56 - bl .printf{PR} - cror CR3_SO,CR3_SO,CR3_SO - cal r3,0(r29) - bl .fflush{PR} - cror CR3_SO,CR3_SO,CR3_SO - ai r3,SP,56 - cal r4,4096(r0) - cal r5,0(r30) - bl .fgets{PR} - cror CR3_SO,CR3_SO,CR3_SO - cmpi 0,r3,0 - bc BO_IF,CR0_EQ,__Lb58 - st r31,0(r27) - bl .expr - b __Lb0c -__Lb58: # 0x00000b58 (H.10.NO_SYMBOL+0xb58) - cal r3,0(r0) - l r12,4200(SP) - ai SP,SP,4192 - mtspr LR,r12 - lm r27,-20(SP) - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x05 # GPR_SAVED=5 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x00 # FLOATPARMS=0,PARMSONSTK=0 - .long 0x000000b0 # TB_OFFSET - .short 4 # NAME_LEN - .byte "main" - .byte 0 # padding - .byte 0 # padding -# End of traceback table -# End csect H.10.NO_SYMBOL{PR} - -# .data section - - - .toc # 0x00000b88 -T.36.line_skip: - .tc H.36.line_skip{TC},line_skip{DS} -T.40.ptr: - .tc H.40.ptr{TC},ptr -T.44.last_ptr: - .tc H.44.last_ptr{TC},last_ptr -T.48.last_token: - .tc H.48.last_token{TC},last_token -T.52.error: - .tc H.52.error{TC},error{DS} -T.56._iob: - .tc H.56._iob{TC},_iob{UA} -T.32._calc_c_: - .tc H.32._calc_c_{TC},E.30._calc_c_{RW} -T.60.token: - .tc H.60.token{TC},token{DS} -T.64.value: - .tc H.64.value{TC},value -T.68.expr: - .tc H.68.expr{TC},expr{DS} -T.72.lvalue: - .tc H.72.lvalue{TC},lvalue -T.76.variable: - .tc H.76.variable{TC},variable -T.80.aexpr: - .tc H.80.aexpr{TC},aexpr{DS} -T.84.mexpr: - .tc H.84.mexpr{TC},mexpr{DS} -T.88.term: - .tc H.88.term{TC},term{DS} -T.92.main: - .tc H.92.main{TC},main{DS} - - - .csect line_skip{DS} - .long .line_skip # "\0\0\0\0" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect line_skip{DS} - - - .csect error{DS} - .long .error # "\0\0\0|" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect error{DS} - - - .csect token{DS} - .long .token # "\0\0\0\330" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect token{DS} - - - .csect expr{DS} - .long .expr # "\0\0\005\274" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect expr{DS} - - - .csect aexpr{DS} - .long .aexpr # "\0\0\a\344" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect aexpr{DS} - - - .csect mexpr{DS} - .long .mexpr # "\0\0\b\314" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect mexpr{DS} - - - .csect term{DS} - .long .term # "\0\0\t\230" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect term{DS} - - - .csect main{DS} - .long .main # "\0\0\n\300" - .long TOC{TC0} # "\0\0\v\210" - .long 0x00000000 # "\0\0\0\0" -# End csect main{DS} - - - .csect E.30._calc_c_{RW}, 3 - .long 0x2573206f # "%s o" - .long 0x6e202573 # "n %s" - .long 0x0a000000 # "\n\0\0\0" - .long 0x3f206578 # "? ex" - .long 0x70726573 # "pres" - .long 0x73696f6e # "sion" - .long 0x206e6f74 # " not" - .long 0x20746572 # " ter" - .long 0x6d696e61 # "mina" - .long 0x74656420 # "ted " - .long 0x77697468 # "with" - .long 0x203a0000 # " :\0\0" - .long 0x42616420 # "Bad " - .long 0x61737369 # "assi" - .long 0x676e6d65 # "gnme" - .long 0x6e740000 # "nt\0\0" - .long 0x42616420 # "Bad " - .long 0x65787072 # "expr" - .long 0x65737369 # "essi" - .long 0x6f6e0000 # "on\0\0" - .long 0x5465726d # "Term" - .long 0x20657870 # " exp" - .long 0x65637465 # "ecte" - .long 0x64000000 # "d\0\0\0" - .long 0x556e6261 # "Unba" - .long 0x6c616e63 # "lanc" - .long 0x65642070 # "ed p" - .long 0x6172656e # "aren" - .long 0x74687369 # "thsi" - .long 0x73000000 # "s\0\0\0" - .long 0x556e6b6e # "Unkn" - .long 0x6f776e20 # "own " - .long 0x7465726d # "term" - .long 0x00000000 # "\0\0\0\0" - .long 0x2573203d # "%s =" - .long 0x20307825 # " 0x%" - .long 0x30387820 # "08x " - .long 0x3d202564 # "= %d" -# End csect E.30._calc_c_{RW} - .long 0x0a000000 # "\n\0\0\0" - - - -# .bss section - .comm ptr, 4 # 0x00000cc4 - .comm last_ptr, 4 # 0x00000cc8 - .comm last_token, 4 # 0x00000ccc - .comm value, 4 # 0x00000cd0 - .comm lvalue, 4 # 0x00000cd4 - .comm variable, 192, 3 # 0x00000cd8
--- a/output.s Fri Nov 09 15:36:02 2007 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,289 +0,0 @@ -.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4 -.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9 -.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14 -.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19 -.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24 -.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29 -.set r30,30; .set r31,31 -.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4 -.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9 -.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14 -.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19 -.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24 -.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29 -.set fp30,30; .set fp31,31 -.set MQ,0; .set XER,1; .set FROM_RTCU,4; .set FROM_RTCL,5; .set FROM_DEC,6 -.set LR,8; .set CTR,9; .set TID,17; .set DSISR,18; .set DAR,19; .set TO_RTCU,20 -.set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24; .set SDR_1,25; .set SRR_0,26 -.set SRR_1,27 -.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1 -.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3 -.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6 -.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9 -.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12 -.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16 -.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19 -.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22 -.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25 -.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28 -.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31 -.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3 -.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7 -.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11 -.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15 -.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19 -.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23 -.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27 -.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31 -.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1 - - .rename H.10.NO_SYMBOL{PR},"" - .rename E.18._test0_c_{RW},"_test0$c$" - .rename H.20._test0_c_{TC},"_test0$c$" - .rename H.24.main{TC},"main" - .rename H.28.variable{TC},"variable" - .rename H.32.print{TC},"print" - -# .lglobl H.10.NO_SYMBOL{PR} - .globl .main - .globl .print -# .lglobl E.18._test0_c_{RW} - .globl main{DS} - .globl variable{RW} - .globl print{DS} - .extern .printf{PR} - - -# .text section - - - .csect H.10.NO_SYMBOL{PR} -.main: # 0x00000000 (H.10.NO_SYMBOL) - .file "test0.c" - mfspr r0,LR - st r31,-4(SP) - st r0,8(SP) - stu SP,-80(SP) -##### 1 - cal r3,1(r0) - bl .print -## 1 -##### 1+2 // expr - cal r3,3(r0) - bl .print -## 1+2 // expr -##### 2*3 // mexpr - cal r3,6(r0) - bl .print -## 2*3 // mexpr -##### 1+(2*3) // term - cal r3,7(r0) - bl .print -## 1+(2*3) // term -##### 1-(2-3) // association - cal r3,2(r0) - bl .print -## 1-(2-3) // association -##### 1-2-3 // association - cal r3,65532(r0) - cau r3,r3,65535 - bl .print -## 1-2-3 // association -##### 1+2*3 // expr order - cal r3,7(r0) - bl .print -## 1+2*3 // expr order -##### 3*2-3 // expr order - cal r3,3(r0) - bl .print -## 3*2-3 // expr order -##### 1+10*10 // token - cal r3,101(r0) - bl .print -## 1+10*10 // token -##### (2+1030/2)-2 - cal r3,515(r0) - bl .print -## (2+1030/2)-2 -##### (255*07)+256 // logical expression - cal r3,2041(r0) - bl .print -## (255*07)+256 // logical expression -##### 0+(1+(2+(3+(4+(5+(6+(7+8)))))))-(0+(1+(2+(3+(4+(5+(6+(7+8)))))))) - cal r3,0(r0) - bl .print -## 0+(1+(2+(3+(4+(5+(6+(7+8)))))))-(0+(1+(2+(3+(4+(5+(6+(7+8)))))))) -##### 100/10 - cal r3,10(r0) - bl .print -## 100/10 -##### a=1*3 - cal r3,3(r0) - l r4,T.28.variable(RTOC) - st r3,0(r4) - bl .print -## a=1*3 -##### b=2*3 - cal r3,6(r0) - l r4,T.28.variable(RTOC) - st r3,4(r4) - bl .print -## b=2*3 -##### a+b - l r4,T.28.variable(RTOC) - l r3,4(r4) - stu r3,-4(SP) - l r4,T.28.variable(RTOC) - l r3,0(r4) - l r4,0(SP) - ai SP,SP,4 - a r3,r3,r4 - bl .print -## a+b -##### a=(b=3*2) - cal r3,6(r0) - l r4,T.28.variable(RTOC) - st r3,4(r4) - l r4,T.28.variable(RTOC) - st r3,0(r4) - bl .print -## a=(b=3*2) -##### a>1 - l r4,T.28.variable(RTOC) - l r3,0(r4) - stu r3,-4(SP) - cal r3,1(r0) - l r4,0(SP) - cmp 0,r4,r3 - ai SP,SP,4 - cal r3,1(r0) - bc BO_IF,CR0_GT,__L0 - cal r3,0(r0) -__L0: - bl .print -## a>1 -##### b - l r4,T.28.variable(RTOC) - l r3,4(r4) - bl .print -## b -##### b>a - l r4,T.28.variable(RTOC) - l r3,4(r4) - stu r3,-4(SP) - l r4,T.28.variable(RTOC) - l r3,0(r4) - l r4,0(SP) - cmp 0,r4,r3 - ai SP,SP,4 - cal r3,1(r0) - bc BO_IF,CR0_GT,__L1 - cal r3,0(r0) -__L1: - bl .print -## b>a - cal r3,0(r0) - l r31,76(SP) - l r0,88(SP) - mtspr LR,r0 - ai SP,SP,80 - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x01 # GPR_SAVED=1 - .byte 0x00 # FIXEDPARMS=0 - .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1 - .long 0x00000048 # TB_OFFSET - .short 4 # NAME_LEN - .byte "main" - .byte 0 # padding - .byte 0 # padding -# End of traceback table -.print: # 0x00000060 (H.10.NO_SYMBOL+0x60) - mfspr r0,LR - st r31,-4(SP) - st r0,8(SP) - stu SP,-80(SP) - l r31,T.20._test0_c_(RTOC) - st r3,104(SP) - cal r3,0(r31) - l r5,104(SP) - cal r4,0(r5) - bl .printf{PR} - cror CR3_SO,CR3_SO,CR3_SO - l r31,76(SP) - l r0,88(SP) - mtspr LR,r0 - ai SP,SP,80 - bcr BO_ALWAYS,CR0_LT -# traceback table - .long 0x00000000 - .byte 0x00 # VERSION=0 - .byte 0x00 # LANG=TB_C - .byte 0x20 # IS_GL=0,IS_EPROL=0,HAS_TBOFF=1 - # INT_PROC=0,HAS_CTL=0,TOCLESS=0 - # FP_PRESENT=0,LOG_ABORT=0 - .byte 0x41 # INT_HNDL=0,NAME_PRESENT=1 - # USES_ALLOCA=0,CL_DIS_INV=WALK_ONCOND - # SAVES_CR=0,SAVES_LR=1 - .byte 0x80 # STORES_BC=1,FPR_SAVED=0 - .byte 0x01 # GPR_SAVED=1 - .byte 0x01 # FIXEDPARMS=1 - .byte 0x01 # FLOATPARMS=0,PARMSONSTK=1 - .long 0x00000000 # - .long 0x00000040 # TB_OFFSET - .short 5 # NAME_LEN - .byte "print" - .byte 0 # padding -# End of traceback table - .long 0x00000000 # "\0\0\0\0" -# End csect H.10.NO_SYMBOL{PR} - -# .data section - - - .toc # 0x000000c0 -T.24.main: - .tc H.24.main{TC},main{DS} -T.28.variable: - .tc H.28.variable{TC},variable -T.32.print: - .tc H.32.print{TC},print{DS} -T.20._test0_c_: - .tc H.20._test0_c_{TC},E.18._test0_c_{RW} - - - .csect main{DS} - .long .main # "\0\0\0\0" - .long TOC{TC0} # "\0\0\0\300" - .long 0x00000000 # "\0\0\0\0" -# End csect main{DS} - - - .csect print{DS} - .long .print # "\0\0\0`" - .long TOC{TC0} # "\0\0\0\300" - .long 0x00000000 # "\0\0\0\0" -# End csect print{DS} - - - .csect E.18._test0_c_{RW}, 3 - .long 0x30782530 # "0x%0" - .long 0x3878203d # "8x =" - .long 0x2025640a # " %d\n" -# End csect E.18._test0_c_{RW} - .long 0x00000000 # "\0\0\0\0" - - - -# .bss section - .comm variable, 256, 3 # 0x000000f8
--- a/s-code-intel-mac.c Fri Nov 09 15:36:02 2007 +0900 +++ b/s-code-intel-mac.c Fri Nov 09 16:23:32 2007 +0900 @@ -29,6 +29,7 @@ static char *ending[] = { +" movl $0, %eax\n", " addl $20, %esp\n", " popl %ebx\n", " popl %ebp\n",
--- a/s-compile.c Fri Nov 09 15:36:02 2007 +0900 +++ b/s-compile.c Fri Nov 09 16:23:32 2007 +0900 @@ -85,13 +85,11 @@ case '*': emit_push(); term(); -/*###88 [cc] `O_MUL' undeclared (first use in this function)%%%*/ emit_calc(O_MUL); break; case '/': emit_push(); term(); -/*###93 [cc] `O_DIV' undeclared (first use in this function)%%%*/ emit_calc(O_DIV); break; default:
--- a/s-tree-compile.c Fri Nov 09 15:36:02 2007 +0900 +++ b/s-tree-compile.c Fri Nov 09 16:23:32 2007 +0900 @@ -5,14 +5,18 @@ #include "s-compile.h" +#include <stdlib.h> // for malloc + static int variable[48]; +#define NEW(type) ((type *)malloc(sizeof(type))) + typedef struct node { struct node *left; struct node *right; int type; int value; -} node; +} node, *node_ptr; static node *expr(); static node *aexpr(); @@ -21,12 +25,8 @@ static node *new_node(); static void print_node(); -static node * -new_node(type,value,left,right) -int type; -int value; -node *left; -node *right; +static node_ptr +new_node(int type,int value,node_ptr left,node_ptr right) { node *d; if ((left && left->type =='0') && @@ -57,7 +57,8 @@ free(left); return right; } } - d = (node *)malloc(sizeof(node)); + // d = (node *)malloc(sizeof(node)); + d = NEW(node); d->type = type; d->value = value; d->left = left; @@ -67,7 +68,7 @@ static void free_node(d) -node *d; +node_ptr d; { if(d->left) { free_node(d->left); @@ -80,7 +81,7 @@ static void code_generate(d) -node *d; +node_ptr d; { int assign; switch(d->type) { @@ -122,7 +123,7 @@ } } -static node * +static node_ptr expr() { int assign; @@ -147,7 +148,7 @@ return d; } -static node * +static node_ptr aexpr() { node *d; @@ -168,7 +169,7 @@ return d; } -static node * +static node_ptr mexpr() { node *d; @@ -189,7 +190,7 @@ return d; } -static node * +static node_ptr term() { node *d;