Mercurial > hg > CbC > old > device
view b10.s @ 850:c5168702f00e a
close this
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Sep 2011 02:01:33 +0900 |
parents | d35df41eac69 |
children |
line wrap: on
line source
.file "mc-parse.c" .version "01.01" gcc2_compiled.: .text # #define EXTERN /**/ # #include "mc.h" # /* Micro-C header file */ # # #define DEBUG error(-1) # # /*#include "CCLIB.TXT" */ # #include "stdio.h" # #define const # # typedef struct { # /* this is all wrong, but so what? */ # char pad[96]; # } FILE; # # # extern FILE __sstdin; # extern FILE __sstdout; # extern FILE __sstderr; # # #define stdin (&__sstdin) # #define stdout (&__sstdout) # #define stderr (&__sstderr) # #define BUFSIZ 1024 /* size of buffer used by setbuf */ # #define EOF (-1) # #define NULL 0 # # typedef int size_t; # typedef /*long*/ int fpos_t; # typedef void *__gnuc_va_list; # # void clearerr(FILE *); # clearerr # 0 # int fclose(FILE *); # fclose # 0 # int feof(FILE *); # feof # 0 # int ferror(FILE *); # ferror # 0 # int fflush(FILE *); # fflush # 0 # int fgetc(FILE *); # fgetc # 0 # int fgetpos(FILE *, fpos_t *); # fgetpos # 0 # 0 # int fileno(FILE *); # fileno # 0 # void flockfile(); # int fprintf(FILE *, const char *, ...); # fprintf # 0 # 0 # 0 # int fpurge(); # int fputc(int, FILE *); # fputc # 0 # 0 # int fputs(const char *, FILE *); # fputs # 0 # 0 # size_t fread(void *, size_t, size_t, FILE *); # fread # 0 # 0 # 0 # 0 # int fscanf(FILE *, const char *, ...); # fscanf # 0 # 0 # 0 # /* int fseek(FILE *, long int, int); */ # int fsetpos(FILE *, const fpos_t *); # fsetpos # 0 # 0 # long ftell(FILE *); # ftell # 0 # int ftrylockfile(); # void funlockfile(); # size_t fwrite(const void *, size_t, size_t, FILE *); # fwrite # 0 # 0 # 0 # 0 # int getc(FILE *); # getc # 0 # int getc_unlocked(); # int getchar(void); # getchar # 0 # int getchar_unlocked(); # int getw(FILE *); # getw # 0 # int pclose(FILE *); # pclose # 0 # void perror(const char *); # perror # 0 # int printf(const char *, ...); # printf # 0 # 0 # int putc(int, FILE *); # putc # 0 # 0 # int putc_unlocked(); # int putchar(int); # putchar # 0 # int putchar_unlocked(); # int puts(const char *); # puts # 0 # int putw(int, FILE *); # putw # 0 # 0 # int remove(const char *); # remove # 0 # int rename (const char *, const char *); # rename # 0 # 0 # void rewind(FILE *); # rewind # 0 # int scanf(const char *, ...); # scanf # 0 # 0 # void setbuf(FILE *, char *); # setbuf # 0 # 0 # void setbuffer(); # int setlinebuf(); # int setvbuf(FILE *, char *, int, size_t); # setvbuf # 0 # 0 # 0 # 0 # int snprintf(); # int sprintf(char *, const char *, ...); # sprintf # 0 # 0 # 0 # int sscanf(const char *, const char *, ...); # sscanf # 0 # 0 # 0 # int ungetc(int, FILE *); # ungetc # 0 # 0 # int vfprintf(FILE *, const char *, __gnuc_va_list); # vfprintf # 0 # 0 # 0 # int vfscanf(); # int vprintf(const char *, __gnuc_va_list); # vprintf # 0 # 0 # int vscanf(); # int vsnprintf(); # int vsprintf(char *, const char *, __gnuc_va_list); # vsprintf # 0 # 0 # 0 # int vsscanf(); # char *ctermid(char *); # ctermid # 0 # FILE *fdopen(int, const char *); # fdopen # 0 # 0 # char *fgetln(); # char *fgets(char *, int, FILE *); # fgets # 0 # 0 # 0 # FILE *fopen(const char *, const char *); # fopen # 0 # 0 # FILE *freopen(const char *, const char *, FILE *); # freopen # 0 # 0 # 0 # FILE *funopen(); # char *gets(char *); # gets # 0 # FILE *popen(const char *, const char *); # popen # 0 # 0 # char *tempnam(const char *, const char *); # tempnam # 0 # 0 # FILE *tmpfile(void); # tmpfile # 0 # char *tmpnam(char *); # tmpnam # 0 # # #define SIZE_INT 4 # # #define INT (-1) # #define CHAR (-2) # #define UNSIGNED (-3) # #define POINTER (-4) # #define ARRAY (-5) # #define STRUCT (-6) # #define UNION (-7) # #define FUNCTION (-8) # #define EMPTY (-9) # # #define STATIC (-10) # #define GOTO (-11) # #define RETURN (-12) # #define BREAK (-13) # #define CONTINUE (-14) # #define IF (-15) # #define ELSE (-16) # #define FOR (-17) # #define DO (-18) # #define WHILE (-19) # #define SWITCH (-20) # #define CASE (-21) # #define DEFAULT (-22) # #define RESERVE (-23) # #define TAG (-24) # #define FIELD (-25) # #define IDENT (-26) # #define STRING (-27) # #define MACRO (-28) # #define BLABEL (-29) # #define FLABEL (-30) # #define TYPEDEF (-31) # #define SIZEOF (-32) # #define TYPE (-33) # #define LONG (-34) # #define SHORT (-35) # #define EXTRN (-36) # #define VOID (-37) # #define REGISTER (-38) # #define CODE (-39) # #define ENVIRONMENT (-40) # # #define TOP 0 # #define GDECL 1 # #define GSDECL 2 # #define GUDECL 3 # #define ADECL 4 # #define LDECL 5 # #define LSDECL 6 # #define LUDECL 7 # #define STADECL 8 # #define STAT 9 # #define GTDECL 10 # #define LTDECL 11 # # #define GVAR 1 # #define RGVAR 2 # #define CRGVAR 3 # #define LVAR 4 # #define RLVAR 5 # #define CRLVAR 6 # #define CONST 7 # #define FNAME 8 # #define INDIRECT 9 # #define RINDIRECT 10 # #define CRINDIRECT 11 # #define ADDRESS 12 # #define MINUS 13 # #define LNOT 14 # #define BNOT 15 # #define INC 16 # #define POSTINC 17 # #define PREINC 18 # #define CPOSTINC 19 # #define CPREINC 20 # #define DEC 21 # #define CPOSTDEC 22 # #define CPREDEC 23 # #define MUL 24 # #define UMUL 25 # #define DIV 26 # #define UDIV 27 # #define MOD 28 # #define UMOD 29 # #define ADD 30 # #define SUB 31 # #define RSHIFT 32 # #define URSHIFT 33 # #define LSHIFT 34 # #define ULSHIFT 35 # #define GT 36 # #define UGT 37 # #define GE 38 # #define UGE 39 # #define LT 40 # #define ULT 41 # #define LE 42 # #define ULE 43 # #define EQ 44 # #define NEQ 45 # #define BAND 46 # #define EOR 47 # #define BOR 48 # #define LAND 49 # #define LOR 50 # #define COND 51 # #define ASS 52 # #define CASS 53 # #define ASSOP 54 # #define CASSOP 55 # #define COMMA 56 # #define LPAR 57 # #define RPAR 58 # #define LBRA 59 # #define RBRA 60 # #define LC 61 # #define RC 62 # #define COLON 63 # #define SM 64 # #define PERIOD 65 # #define ARROW 66 # #define CNAME 67 # #define SASS 68 # #define DOTS 69 # # #define US 1 # #define AS 100 # # #define FILERR 1 # #define DCERR 2 # #define STERR 3 # #define EXERR 4 # #define CNERR 5 # #define CHERR 6 # #define GSERR 7 # #define LSERR 8 # #define STRERR 9 # #define LNERR 10 # #define EOFERR 11 # #define MCERR 12 # #define INCERR 13 # #define HPERR 14 # #define TYERR 15 # #define LVERR 16 # #define UDERR 17 # #define OPTION 18 # #define REG_ERR 19 # #define CODE_ERR 20 # # #define GSYMS 9000 # #define LSYMS 500 # # #define HEAPSIZE 10000 # /* #define CHEAPSIZE 3000 */ # #define CHEAPSIZE 256000 # #define LBUFSIZE 4096 # # #define FILES 3 # #define OUTPUT_FILE_NAME "mcout.s" # # EXTERN int sym,ch,chsave,type,mode,stmode,gfree,lfree,mflag,lineno,glineno; # EXTERN int labelno,gpc,disp,reg_var,debug; # EXTERN int symval,args,init_vars,heap[HEAPSIZE]; # EXTERN int blabel,clabel,dlabel,cslabel,ilabel,control,ac,ac2,lsrc,chk,asmf; # EXTERN int MAX_REGISTER_VAR; # # EXTERN unsigned hash; # # EXTERN char linebuf[LBUFSIZE],namebuf[LBUFSIZE],*chptr,*chptrsave; # EXTERN char *name,*cheapp,**av,/*obuf[320],*/*sptr,escape(void); # escape # 0 # EXTERN int arg_offset,stat_no,int_size,disp_offset,endian,csvalue,csvalue1; # EXTERN int code_arg_offset; # EXTERN int retlabel,retpending,retcont; # # EXTERN FILE *obuf; # # typedef struct nametable { # char *nm; # int sc,ty,dsp; } NMTBL; # # EXTERN NMTBL ntable[GSYMS+LSYMS],*nptr,*gnptr,*decl0(void),*decl1(void),*lsearch(char *name),*gsearch(void); # decl0 # 0 # decl1 # 0 # lsearch # 0 # gsearch # 0 # EXTERN NMTBL *fnptr; # # EXTERN struct {int fd,ln;/*char fcb[320]*/FILE *fcb;} *filep,filestack[FILES]; # EXTERN char cheap[CHEAPSIZE]; # # # void ntable_consistency(); # static void adecl(NMTBL *n); # adecl # 0 # static void decl_data(int t, NMTBL *n); # decl_data # 0 # 0 # static int alpha(char c); # alpha # 0 # static int binop(int op, int e1, int e2, int t1, int t2); # binop # 0 # 0 # 0 # 0 # 0 # int caddr(int e); # caddr # 0 # int cadr(int e); # cadr # 0 # int car(int e); # car # 0 # static void compatible(int t1, int t2); # compatible # 0 # 0 # static void decl(void); # decl # 0 # static void def(NMTBL *n); # def # 0 # static int digit(char c); # digit # 0 # static void docase(void); # docase # 0 # static void docomp(void); # docomp # 0 # static void dodefault(void); # dodefault # 0 # static void dodo(void); # dodo # 0 # static void dofor(void); # dofor # 0 # static void dogoto(void); # dogoto # 0 # static void doif(void); # doif # 0 # static void dolabel(void); # dolabel # 0 # static void doswitch(void); # doswitch # 0 # static void doreturn(void); # doreturn # 0 # static void dowhile(void); # dowhile # 0 # static void errmsg(void); # errmsg # 0 # static void copy(NMTBL *nptr, char *s); # copy # 0 # 0 # void error(int n); # error # 0 # static int expr(void); # expr # 0 # static int expr0(void); # expr0 # 0 # static int expr1(void); # expr1 # 0 # static int expr2(void); # expr2 # 0 # static int expr3(void); # expr3 # 0 # static int expr4(void); # expr4 # 0 # static int expr5(void); # expr5 # 0 # static int expr6(void); # expr6 # 0 # static int expr7(void); # expr7 # 0 # static int expr8(void); # expr8 # 0 # static int expr9(void); # expr9 # 0 # static int expr10(void); # expr10 # 0 # static int expr11(void); # expr11 # 0 # static int expr12(void); # expr12 # 0 # static int expr13(void); # expr13 # 0 # static int expr14(void); # expr14 # 0 # static int expr15(int e1); # expr15 # 0 # static int expr16(int e1); # expr16 # 0 # static void fcheck(NMTBL *n); # fcheck # 0 # static void fdecl(NMTBL *n); # fdecl # 0 # static int getch(void); # getch # 0 # static int getfree(int n); # getfree # 0 # static void getline(void); # getline # 0 # static void getstring(void); # getstring # 0 # static int getsym(void); # getsym # 0 # static int indop(int e); # indop # 0 # static void init(void); # init # 0 # static int integral(int t); # integral # 0 # static void lcheck(int e); # lcheck # 0 # int list2(int e1, int e2); # list2 # 0 # 0 # int list3(int e1, int e2, int e3); # list3 # 0 # 0 # 0 # int list4(int e1, int e2, int e3, int e4); # list4 # 0 # 0 # 0 # 0 # static void reserve(char *s, int d); # reserve # 0 # 0 # static int macroeq(char *s); # macroeq # 0 # static int ndecl0(void); # ndecl0 # 0 # static int ndecl1(void); # ndecl1 # 0 # static int neqname(char *p); # neqname # 0 # static void newfile(void); # newfile # 0 # static int postequ(int s1, int s2); # postequ # 0 # 0 # static void reverse(int t1); # reverse # 0 # static int reverse0(int t1); # reverse0 # 0 # static int rplacad(int e, int n); # rplacad # 0 # 0 # static int rvalue(int e); # rvalue # 0 # static int scalar(int t); # scalar # 0 # static int sdecl(int s); # sdecl # 0 # static int skipspc(void); # skipspc # 0 # static void statement(void); # statement # 0 # static int strop(int e); # strop # 0 # static int typeid(int s); # typeid # 0 # static int typename(void); # typename # 0 # static int typespec(void); # typespec # 0 # static int cexpr(int e); # cexpr # 0 # static void code_decl(NMTBL *n); # code_decl # 0 # # extern void exit(int); # exit # 0 # extern void closing(void); # closing # 0 # extern void opening(char *filename); # opening # 0 # extern void gen_gdecl(char *n, int gpc); # gen_gdecl # 0 # 0 # extern void enter(char *name); # enter # 0 # extern void enter1(int disp); # enter1 # 0 # extern void leave(int control, char *name); # leave # 0 # 0 # extern void ret(void); # ret # 0 # extern void jmp(int l); # jmp # 0 # extern void gexpr(int e1); # gexpr # 0 # extern int get_register_var(void); # get_register_var # 0 # extern void bexpr(int e1, char cond, int l1); # bexpr # 0 # 0 # 0 # extern int fwdlabel(void); # fwdlabel # 0 # extern void fwddef(int l); # fwddef # 0 # extern int backdef(void); # backdef # 0 # extern int def_label(int cslabel, int dlabel); # def_label # 0 # 0 # extern void jmp_label(int l); # jmp_label # 0 # extern void cmpdimm(int e, int csreg); # cmpdimm # 0 # 0 # extern void jcond(int l, char cond); # jcond # 0 # 0 # extern void jmp_eq_label(int l); # jmp_eq_label # 0 # extern void gen_comment(char *s); # gen_comment # 0 # extern void gen_source(char *s); # gen_source # 0 # extern void code_init(void); # code_init # 0 # extern void emit_data_closing(NMTBL *n); # emit_data_closing # 0 # extern void emit_data(int e, int t, NMTBL *n); # emit_data # 0 # 0 # 0 # # int # main(int argc, char **argv) # main # 0 # 0 # { .align 2 .globl main main: .type main,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *nptr; # int i; # char *ccout; # # if(argc==1) exit(1); subl $12,%esp movl $1,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _3 movl $1,%ecx pushl %ecx call exit addl $4,%esp # lsrc = chk = asmf = 0; _3: movl $0,%eax movl %eax,asmf movl %eax,chk movl %eax,lsrc # ccout = OUTPUT_FILE_NAME; .section .rodata _4: .string "mcout.s" .text lea _4,%eax movl %eax,-24(%ebp) # ac=argc; movl 8(%ebp),%eax movl %eax,ac # av=argv; movl 12(%ebp),%eax movl %eax,av # for (ac2=1; (ac2 < ac) && (*av[ac2] == '-'); ++ac2) { movl $1,%eax movl %eax,ac2 _6: movl ac,%eax movl ac2,%ecx subl %eax,%ecx jge _5 movl $45,%ecx movl av,%eax movl $4,%edx pushl %edx movl ac2,%edx popl %ebx imull %ebx,%edx addl %eax,%edx movl (%edx),%edx movsbl (%edx),%edx subl %ecx,%edx jne _5 # switch (*(av[ac2]+1)) { movl $1,%edx movl av,%ecx movl $4,%eax pushl %eax movl ac2,%eax popl %ebx imull %ebx,%eax addl %ecx,%eax movl (%eax),%eax addl %edx,%eax movsbl (%eax),%eax # case 'S': case 's': # lsrc = 1; cmpl $115,%eax je _9 cmpl $83,%eax jne _10 _9: movl $1,%eax movl %eax,lsrc # break; jmp _8 # case 'O': case 'o': # ccout = av[ac2]+2; _10: cmpl $111,%eax je _11 cmpl $79,%eax jne _12 _11: movl $2,%eax movl av,%ecx movl $4,%edx pushl %edx movl ac2,%edx popl %ebx imull %ebx,%edx addl %ecx,%edx movl (%edx),%edx addl %eax,%edx movl %edx,-24(%ebp) # break; jmp _8 # case 'C': case 'c': # chk = 1; _12: cmpl $99,%eax je _13 cmpl $67,%eax jne _14 _13: movl $1,%eax movl %eax,chk # break; jmp _8 # case 'D': case 'd': # debug = 1; _14: cmpl $100,%eax je _15 cmpl $68,%eax jne _16 _15: movl $1,%eax movl %eax,debug # break; jmp _8 # default: # error(OPTION); _17: movl $18,%eax pushl %eax call error addl $4,%esp # exit(1); movl $1,%eax pushl %eax call exit addl $4,%esp # } # } jmp _18 _16: jmp _17 _18: _8: # fclose(stdout); _7: movl $ac2,%eax addl $1,(%eax) movl (%eax),%eax jmp _6 _5: movl $__sstdout,%eax pushl %eax call fclose addl $4,%esp # if (!chk) cmpl $0,chk jne _19 # if ( (obuf = fopen(ccout,"w")) == NULL ) error(FILERR); movl $0,%eax .section .rodata _21: .string "w" .text lea _21,%ecx pushl %ecx movl -24(%ebp),%ecx pushl %ecx xchg %ecx,%eax call fopen addl $8,%esp movl %eax,obuf subl %ecx,%eax jne _20 movl $1,%eax pushl %eax call error addl $4,%esp # init(); _20: _19: call init # while(1) { _23: # for (nptr = &ntable[GSYMS],i=LSYMS; i--;) movl $144000,%eax movl $ntable,%edx addl %eax,%edx movl %edx,-16(%ebp) movl $500,%edx movl %edx,-20(%ebp) _25: lea -20(%ebp),%edx movl (%edx),%eax addl $-1,(%edx) cmpl $0,%eax je _24 # (nptr++)->sc = 0; movl $0,%eax movl $4,%edx lea -16(%ebp),%ecx pushl %ecx popl %ebx movl (%ebx),%ecx addl $16,(%ebx) addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # mode=TOP; jmp _25 _24: movl $0,%ecx movl %ecx,mode # lfree= HEAPSIZE; movl $10000,%ecx movl %ecx,lfree # while(getsym()==SM); _27: movl $64,%ecx call getsym subl %ecx,%eax je _27 # mode=GDECL; _26: movl $1,%eax movl %eax,mode # stmode=0; movl $0,%eax movl %eax,stmode # args=0; movl $0,%eax movl %eax,args # decl(); call decl # } # /*NOTREACHED*/ # } jmp _23 _22: _2: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _28: .size main,_28-main # # void # error(int n) # error # 599 # { .align 2 .globl error error: .type error,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(n == EOFERR) { movl $11,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _30 # if(filep!=filestack) { movl $filestack,%ecx movl filep,%eax subl %ecx,%eax je _31 # fclose(filep->fcb); movl $8,%eax movl filep,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call fclose addl $4,%esp # lineno=filep->ln; movl $4,%eax movl filep,%ecx addl %eax,%ecx movl (%ecx),%ecx movl %ecx,lineno # --filep; movl $filep,%ecx addl $-12,(%ecx) movl (%ecx),%ecx # return; # } else if(ac2!=ac) { movl %ecx,%eax jmp _29 _31: movl ac,%eax movl ac2,%ecx subl %eax,%ecx je _32 # fclose(filep->fcb); movl $8,%ecx movl filep,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax call fclose addl $4,%esp # newfile(); call newfile # return; # } else if(mode == TOP) { jmp _29 _32: movl $0,%eax movl mode,%ecx subl %eax,%ecx jne _33 # /* # if (!chk) fprintf(stderr, # "Total internal labels : %u.\n",labelno-1); # fprintf(stderr, # "Total global variables : %u bytes.\n\n",gpc); # */ # closing(); call closing # exit(0); movl $0,%eax pushl %eax call exit addl $4,%esp # } # } _33: # fprintf(stderr,"%5d:%s.\n",lineno, _30: # (n==FILERR) ? "Can't open specified file" : # (n==DCERR) ? "Declaration syntax" : # (n==STERR) ? "Statement syntax" : # (n==EXERR) ? "Expression syntax" : # (n==CNERR) ? "Constant required" : # (n==CHERR) ? "Illegal character" : # (n==GSERR) ? "Too many global symbols" : # (n==LSERR) ? "Too many local symbols" : # (n==STRERR) ? "Too many strings or macros" : # (n==LNERR) ? "Line too long" : # (n==EOFERR) ? "Unexpected end of file" : # (n==MCERR) ? "Macro syntax" : # (n==INCERR) ? "Include syntax" : # (n==HPERR) ? "Too long expression" : # (n==TYERR) ? "Type mismatch" : # (n==LVERR) ? "Lvalue required" : # (n==UDERR) ? "Undeclared identifier" : # (n==OPTION) ? "Illegal option" : # (n==REG_ERR) ? "illegal register var" : # (n==CODE_ERR) ? "goto code is necessary" : # "Bug of compiler"); movl $1,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _34 .section .rodata _35: .string "Can't open specified file" .text lea _35,%ecx jmp _36 _34: movl $2,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _37 .section .rodata _38: .string "Declaration syntax" .text lea _38,%eax jmp _39 _37: movl $3,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _40 .section .rodata _41: .string "Statement syntax" .text lea _41,%ecx jmp _42 _40: movl $4,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _43 .section .rodata _44: .string "Expression syntax" .text lea _44,%eax jmp _45 _43: movl $5,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _46 .section .rodata _47: .string "Constant required" .text lea _47,%ecx jmp _48 _46: movl $6,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _49 .section .rodata _50: .string "Illegal character" .text lea _50,%eax jmp _51 _49: movl $7,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _52 .section .rodata _53: .string "Too many global symbols" .text lea _53,%ecx jmp _54 _52: movl $8,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _55 .section .rodata _56: .string "Too many local symbols" .text lea _56,%eax jmp _57 _55: movl $9,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _58 .section .rodata _59: .string "Too many strings or macros" .text lea _59,%ecx jmp _60 _58: movl $10,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _61 .section .rodata _62: .string "Line too long" .text lea _62,%eax jmp _63 _61: movl $11,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _64 .section .rodata _65: .string "Unexpected end of file" .text lea _65,%ecx jmp _66 _64: movl $12,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _67 .section .rodata _68: .string "Macro syntax" .text lea _68,%eax jmp _69 _67: movl $13,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _70 .section .rodata _71: .string "Include syntax" .text lea _71,%ecx jmp _72 _70: movl $14,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _73 .section .rodata _74: .string "Too long expression" .text lea _74,%eax jmp _75 _73: movl $15,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _76 .section .rodata _77: .string "Type mismatch" .text lea _77,%ecx jmp _78 _76: movl $16,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _79 .section .rodata _80: .string "Lvalue required" .text lea _80,%eax jmp _81 _79: movl $17,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _82 .section .rodata _83: .string "Undeclared identifier" .text lea _83,%ecx jmp _84 _82: movl $18,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _85 .section .rodata _86: .string "Illegal option" .text lea _86,%eax jmp _87 _85: movl $19,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _88 .section .rodata _89: .string "illegal register var" .text lea _89,%ecx jmp _90 _88: movl $20,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _91 .section .rodata _92: .string "goto code is necessary" .text lea _92,%eax jmp _93 _91: .section .rodata _94: .string "Bug of compiler" .text lea _94,%eax _93: movl %eax,%ecx _90: movl %ecx,%eax _87: movl %eax,%ecx _84: movl %ecx,%eax _81: movl %eax,%ecx _78: movl %ecx,%eax _75: movl %eax,%ecx _72: movl %ecx,%eax _69: movl %eax,%ecx _66: movl %ecx,%eax _63: movl %eax,%ecx _60: movl %ecx,%eax _57: movl %eax,%ecx _54: movl %ecx,%eax _51: movl %eax,%ecx _48: movl %ecx,%eax _45: movl %eax,%ecx _42: movl %ecx,%eax _39: movl %eax,%ecx _36: pushl %ecx movl lineno,%ecx pushl %ecx .section .rodata _95: .string "%5d:%s.\n" .text lea _95,%ecx pushl %ecx movl $__sstderr,%ecx pushl %ecx call fprintf addl $16,%esp # errmsg(); call errmsg # exit(1); movl $1,%eax pushl %eax call exit addl $4,%esp # } _29: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _96: .size error,_96-error # # void # errmsg(void) # errmsg # 589 # { .align 2 .globl errmsg errmsg: .type errmsg,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # char *p,*lim; # # if(lineno==0) return; subl $8,%esp movl $0,%eax movl lineno,%ecx subl %eax,%ecx jne _98 # fprintf(stderr,"%s",linebuf); movl %ecx,%eax jmp _97 _98: movl $linebuf,%eax pushl %eax .section .rodata _99: .string "%s" .text lea _99,%eax pushl %eax movl $__sstderr,%eax pushl %eax call fprintf addl $12,%esp # lim=(mflag?chptrsave:chptr); cmpl $0,mflag je _100 movl chptrsave,%eax jmp _101 _100: movl chptr,%eax _101: movl %eax,-20(%ebp) # for (p=linebuf; p < lim;) movl $linebuf,%eax movl %eax,-16(%ebp) _103: movl -20(%ebp),%eax movl -16(%ebp),%ecx subl %eax,%ecx jae _102 # fprintf(stderr,(*p++ == '\t') ? "\t" : " "); movl $9,%ecx lea -16(%ebp),%eax movl (%eax),%edx addl $1,(%eax) movsbl (%edx),%edx subl %ecx,%edx jne _104 .section .rodata _105: .string "\011" .text lea _105,%edx jmp _106 _104: .section .rodata _107: .string " " .text lea _107,%edx _106: pushl %edx movl $__sstderr,%edx pushl %edx call fprintf addl $8,%esp # fprintf (stderr,"^\n"); jmp _103 _102: .section .rodata _108: .string "^\n" .text lea _108,%eax pushl %eax movl $__sstderr,%eax pushl %eax call fprintf addl $8,%esp # } _97: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _109: .size errmsg,_109-errmsg # # void # checksym(int s) # checksym # 0 # { .align 2 .globl checksym checksym: .type checksym,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # char *p; # # if (sym != s) { subl $4,%esp movl 8(%ebp),%eax movl sym,%ecx subl %eax,%ecx je _111 # p=(s==RPAR) ? "')'": (s==RBRA) ? "']'": (s==SM) ? "';'": # (s==LPAR) ? "'('": (s==WHILE) ? "'while'": # (s==COLON) ? "':'": "Identifier"; movl $58,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _112 .section .rodata _113: .string "')'" .text lea _113,%eax jmp _114 _112: movl $60,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _115 .section .rodata _116: .string "']'" .text lea _116,%ecx jmp _117 _115: movl $64,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _118 .section .rodata _119: .string "';'" .text lea _119,%eax jmp _120 _118: movl $57,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _121 .section .rodata _122: .string "'('" .text lea _122,%ecx jmp _123 _121: movl $-19,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _124 .section .rodata _125: .string "'while'" .text lea _125,%eax jmp _126 _124: movl $63,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _127 .section .rodata _128: .string "':'" .text lea _128,%ecx jmp _129 _127: .section .rodata _130: .string "Identifier" .text lea _130,%ecx _129: movl %ecx,%eax _126: movl %eax,%ecx _123: movl %ecx,%eax _120: movl %eax,%ecx _117: movl %ecx,%eax _114: movl %eax,-16(%ebp) # fprintf(stderr,"%d:%s expected.\n",lineno,p); movl -16(%ebp),%eax pushl %eax movl lineno,%eax pushl %eax .section .rodata _131: .string "%d:%s expected.\n" .text lea _131,%eax pushl %eax movl $__sstderr,%eax pushl %eax call fprintf addl $16,%esp # errmsg(); call errmsg # } else jmp _132 _111: # getsym(); call getsym # } _132: _110: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _133: .size checksym,_133-checksym # # void # init(void) # init # 734 # { .align 2 .globl init init: .type init,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *nptr; # int i; # # cheapp=cheap; subl $8,%esp movl $cheap,%eax movl %eax,cheapp # for(nptr = ntable,i = GSYMS; i--;) (nptr++)->sc = 0; movl $ntable,%eax movl %eax,-16(%ebp) movl $9000,%eax movl %eax,-20(%ebp) _136: lea -20(%ebp),%eax movl (%eax),%ecx addl $-1,(%eax) cmpl $0,%ecx je _135 movl $0,%ecx movl $4,%eax lea -16(%ebp),%edx pushl %edx popl %ebx movl (%ebx),%edx addl $16,(%ebx) addl %eax,%edx movl %ecx,(%edx) movl %ecx,%edx # reserve("int",INT); jmp _136 _135: movl $-1,%edx pushl %edx .section .rodata _137: .string "int" .text lea _137,%edx pushl %edx call reserve addl $8,%esp # reserve("void",VOID); movl $-37,%eax pushl %eax .section .rodata _138: .string "void" .text lea _138,%eax pushl %eax call reserve addl $8,%esp # reserve("char",CHAR); movl $-2,%eax pushl %eax .section .rodata _139: .string "char" .text lea _139,%eax pushl %eax call reserve addl $8,%esp # reserve("struct",STRUCT); movl $-6,%eax pushl %eax .section .rodata _140: .string "struct" .text lea _140,%eax pushl %eax call reserve addl $8,%esp # reserve("union",UNION); movl $-7,%eax pushl %eax .section .rodata _141: .string "union" .text lea _141,%eax pushl %eax call reserve addl $8,%esp # reserve("unsigned",UNSIGNED); movl $-3,%eax pushl %eax .section .rodata _142: .string "unsigned" .text lea _142,%eax pushl %eax call reserve addl $8,%esp # reserve("static",STATIC); movl $-10,%eax pushl %eax .section .rodata _143: .string "static" .text lea _143,%eax pushl %eax call reserve addl $8,%esp # reserve("goto",GOTO); movl $-11,%eax pushl %eax .section .rodata _144: .string "goto" .text lea _144,%eax pushl %eax call reserve addl $8,%esp # reserve("return",RETURN); movl $-12,%eax pushl %eax .section .rodata _145: .string "return" .text lea _145,%eax pushl %eax call reserve addl $8,%esp # reserve("break",BREAK); movl $-13,%eax pushl %eax .section .rodata _146: .string "break" .text lea _146,%eax pushl %eax call reserve addl $8,%esp # reserve("continue",CONTINUE); movl $-14,%eax pushl %eax .section .rodata _147: .string "continue" .text lea _147,%eax pushl %eax call reserve addl $8,%esp # reserve("if",IF); movl $-15,%eax pushl %eax .section .rodata _148: .string "if" .text lea _148,%eax pushl %eax call reserve addl $8,%esp # reserve("else",ELSE); movl $-16,%eax pushl %eax .section .rodata _149: .string "else" .text lea _149,%eax pushl %eax call reserve addl $8,%esp # reserve("for",FOR); movl $-17,%eax pushl %eax .section .rodata _150: .string "for" .text lea _150,%eax pushl %eax call reserve addl $8,%esp # reserve("do",DO); movl $-18,%eax pushl %eax .section .rodata _151: .string "do" .text lea _151,%eax pushl %eax call reserve addl $8,%esp # reserve("while",WHILE); movl $-19,%eax pushl %eax .section .rodata _152: .string "while" .text lea _152,%eax pushl %eax call reserve addl $8,%esp # reserve("switch",SWITCH); movl $-20,%eax pushl %eax .section .rodata _153: .string "switch" .text lea _153,%eax pushl %eax call reserve addl $8,%esp # reserve("case",CASE); movl $-21,%eax pushl %eax .section .rodata _154: .string "case" .text lea _154,%eax pushl %eax call reserve addl $8,%esp # reserve("default",DEFAULT); movl $-22,%eax pushl %eax .section .rodata _155: .string "default" .text lea _155,%eax pushl %eax call reserve addl $8,%esp # reserve("typedef",TYPEDEF); movl $-31,%eax pushl %eax .section .rodata _156: .string "typedef" .text lea _156,%eax pushl %eax call reserve addl $8,%esp # reserve("sizeof",SIZEOF); movl $-32,%eax pushl %eax .section .rodata _157: .string "sizeof" .text lea _157,%eax pushl %eax call reserve addl $8,%esp # reserve("long",LONG); movl $-34,%eax pushl %eax .section .rodata _158: .string "long" .text lea _158,%eax pushl %eax call reserve addl $8,%esp # reserve("short",SHORT); movl $-35,%eax pushl %eax .section .rodata _159: .string "short" .text lea _159,%eax pushl %eax call reserve addl $8,%esp # reserve("extern",EXTRN); movl $-36,%eax pushl %eax .section .rodata _160: .string "extern" .text lea _160,%eax pushl %eax call reserve addl $8,%esp # reserve("register",REGISTER); movl $-38,%eax pushl %eax .section .rodata _161: .string "register" .text lea _161,%eax pushl %eax call reserve addl $8,%esp # reserve("code",CODE); movl $-39,%eax pushl %eax .section .rodata _162: .string "code" .text lea _162,%eax pushl %eax call reserve addl $8,%esp # reserve("environment",ENVIRONMENT); movl $-40,%eax pushl %eax .section .rodata _163: .string "environment" .text lea _163,%eax pushl %eax call reserve addl $8,%esp # gpc=glineno=mflag=0; movl $0,%eax movl %eax,mflag movl %eax,glineno movl %eax,gpc # gfree=ilabel=1; movl $1,%eax movl %eax,ilabel movl %eax,gfree # labelno=2; movl $2,%eax movl %eax,labelno # lfree=HEAPSIZE; movl $10000,%eax movl %eax,lfree # filep=filestack; movl $filestack,%eax movl %eax,filep # code_init(); call code_init # newfile(); call newfile # getline(); call getline # getch(); call getch # } _134: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _164: .size init,_164-init # # void # newfile(void) # newfile # 789 # { .align 2 .globl newfile newfile: .type newfile,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # lineno=0; movl $0,%eax movl %eax,lineno # /* fprintf(stderr,"%s:\n",av[ac2]); */ # opening(av[ac2]); movl av,%eax movl $4,%ecx movl ac2,%edx imull %ecx,%edx addl %eax,%edx movl (%edx),%edx pushl %edx call opening addl $4,%esp # if ( (filep->fcb = fopen(av[ac2++],"r")) == NULL ) error(FILERR); movl $0,%eax .section .rodata _167: .string "r" .text lea _167,%edx pushl %edx movl av,%edx movl $4,%ecx pushl %ecx movl $ac2,%ecx pushl %ecx popl %ebx movl (%ebx),%ecx addl $1,(%ebx) popl %ebx imull %ebx,%ecx addl %edx,%ecx movl (%ecx),%ecx pushl %ecx xchg %ecx,%eax call fopen addl $8,%esp movl $8,%edx pushl %edx movl filep,%edx popl %ebx addl %ebx,%edx movl %eax,(%edx) movl %eax,%edx subl %ecx,%edx jne _166 movl $1,%edx pushl %edx call error addl $4,%esp # } _166: _165: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _168: .size newfile,_168-newfile # # void # reserve(char *s, int d) # reserve # 764 # 764 # { .align 2 .globl reserve reserve: .type reserve,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *nptr; # int i; # # hash=0; name=namebuf; i=0; subl $8,%esp movl $0,%eax movl %eax,hash movl $namebuf,%eax movl %eax,name movl $0,%eax movl %eax,-20(%ebp) # while((name[i++] = *s)) { _171: movl 8(%ebp),%eax movsbl (%eax),%eax movl name,%ecx lea -20(%ebp),%edx pushl %edx popl %ebx movl (%ebx),%edx addl $1,(%ebx) addl %ecx,%edx movb %eax,(%edx) movl %eax,%edx cmpl $0,%edx je _170 # hash=((7*hash) ^ *s++); lea 8(%ebp),%edx movl (%edx),%eax addl $1,(%edx) movsbl (%eax),%eax movl $7,%ecx movl hash,%edx imull %ecx,%edx xorl %eax,%edx movl %edx,hash # } # if (cheapp+i >= cheap+CHEAPSIZE) error(STRERR); jmp _171 _170: movl $256000,%edx movl $cheap,%eax addl %edx,%eax movl cheapp,%ecx movl -20(%ebp),%edx addl %ecx,%edx subl %eax,%edx jb _172 movl $9,%edx pushl %edx call error addl $4,%esp # name[i++] = 0; _172: movl $0,%eax movl name,%edx lea -20(%ebp),%ecx pushl %ecx popl %ebx movl (%ebx),%ecx addl $1,(%ebx) addl %edx,%ecx movb %eax,(%ecx) movl %eax,%ecx # (nptr = gsearch())->sc = RESERVE; movl $-23,%ecx movl $4,%edx call gsearch movl %eax,-16(%ebp) addl %edx,%eax movl %ecx,(%eax) movl %ecx,%eax # nptr->dsp = d; movl 12(%ebp),%eax movl $12,%edx movl -16(%ebp),%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # } movl %ecx,%eax _169: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _173: .size reserve,_173-reserve # # static # NMTBL null_nptr; # # void # decl(void) # decl # 519 # { .align 2 .globl decl decl: .type decl,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *n; # int t; # # if(sym==STATIC) { subl $8,%esp movl $-10,%eax movl sym,%ecx subl %eax,%ecx jne _175 # if(mode==LDECL) { movl $5,%ecx movl mode,%eax subl %ecx,%eax jne _176 # getsym(); call getsym # mode=STADECL; movl $8,%eax movl %eax,mode # stmode=LDECL; movl $5,%eax movl %eax,stmode # } else if(mode==GDECL) { jmp _177 _176: movl $1,%eax movl mode,%ecx subl %eax,%ecx jne _178 # getsym(); call getsym # stmode=STATIC; movl $-10,%eax movl %eax,stmode # } else jmp _179 _178: # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # } else if(sym==REGISTER) { _179: _177: jmp _180 _175: movl $-38,%eax movl sym,%ecx subl %eax,%ecx jne _181 # if(mode!=LDECL) movl $5,%ecx movl mode,%eax subl %ecx,%eax je _182 # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # stmode=REGISTER; _182: movl $-38,%eax movl %eax,stmode # getsym(); call getsym # } else if(sym==EXTRN) { jmp _183 _181: movl $-36,%eax movl sym,%ecx subl %eax,%ecx jne _184 # getsym(); call getsym # stmode=EXTRN; movl $-36,%eax movl %eax,stmode # } else if(sym==TYPEDEF) { jmp _185 _184: movl $-31,%eax movl sym,%ecx subl %eax,%ecx jne _186 # if(mode==GDECL) { movl $1,%ecx movl mode,%eax subl %ecx,%eax jne _187 # getsym(); call getsym # mode=GTDECL; movl $10,%eax movl %eax,mode # } else if(mode==LDECL) { jmp _188 _187: movl $5,%eax movl mode,%ecx subl %eax,%ecx jne _189 # getsym(); call getsym # mode=LTDECL; movl $11,%eax movl %eax,mode # } else jmp _190 _189: # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # } _190: _188: # if((t=typespec())==0) return; _186: _185: _183: _180: movl $0,%eax xchg %ecx,%eax call typespec movl %eax,-20(%ebp) subl %ecx,%eax jne _191 # if(sym==SM) return; jmp _174 _191: movl $64,%eax movl sym,%ecx subl %eax,%ecx jne _192 # type=t; movl %ecx,%eax jmp _174 _192: movl -20(%ebp),%eax movl %eax,type # n=decl0(); call decl0 movl %eax,-16(%ebp) # reverse(t); movl -20(%ebp),%eax pushl %eax call reverse addl $4,%esp # if (n == &null_nptr) { movl $null_nptr,%eax movl -16(%ebp),%ecx subl %eax,%ecx jne _193 # error(DCERR); movl $2,%ecx pushl %ecx call error addl $4,%esp # return; # } jmp _174 # if(sym==LC || ( sym!=SM && sym!=COMMA && sym!=ASS )) { _193: movl $61,%eax movl sym,%ecx subl %eax,%ecx je _195 movl $64,%ecx movl sym,%eax subl %ecx,%eax je _194 movl $56,%eax movl sym,%ecx subl %eax,%ecx je _194 movl $52,%ecx movl sym,%eax subl %ecx,%eax je _194 _195: # if (car(type)==CODE) { movl $-39,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _196 # code_decl(n); return; movl -16(%ebp),%eax pushl %eax call code_decl addl $4,%esp # } else if (car(type)==FUNCTION) { jmp _174 _196: movl $-8,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _197 # fdecl(n); return; movl -16(%ebp),%eax pushl %eax call fdecl addl $4,%esp # } jmp _174 # } _197: # def(n); _194: movl -16(%ebp),%eax pushl %eax call def addl $4,%esp # while(sym==COMMA) { _199: movl $56,%eax movl sym,%ecx subl %eax,%ecx jne _198 # getsym(); call getsym # type=t; movl -20(%ebp),%eax movl %eax,type # n=decl0(); call decl0 movl %eax,-16(%ebp) # reverse(t); movl -20(%ebp),%eax pushl %eax call reverse addl $4,%esp # if(n == &null_nptr) error(DCERR); movl $null_nptr,%eax movl -16(%ebp),%ecx subl %eax,%ecx jne _200 movl $2,%ecx pushl %ecx call error addl $4,%esp # /* if(args) error(DCERR); */ # def(n); _200: movl -16(%ebp),%eax pushl %eax call def addl $4,%esp # } # if(sym!=SM) error(DCERR); jmp _199 _198: movl $64,%eax movl sym,%ecx subl %eax,%ecx je _201 movl $2,%ecx pushl %ecx call error addl $4,%esp # if(mode==GTDECL) _201: movl $10,%eax movl mode,%ecx subl %eax,%ecx jne _202 # mode=GDECL; movl $1,%ecx movl %ecx,mode # if(mode==STADECL||mode==LTDECL) _202: movl $8,%ecx movl mode,%eax subl %ecx,%eax je _204 movl $11,%eax movl mode,%ecx subl %eax,%ecx jne _203 _204: # mode=LDECL; movl $5,%ecx movl %ecx,mode # } _203: movl %ecx,%eax _174: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _205: .size decl,_205-decl # # int # typespec(void) # typespec # 854 # { .align 2 .globl typespec typespec: .type typespec,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t; # # switch(sym) { subl $4,%esp movl sym,%eax # case VOID: # case INT: # case CHAR: # case CODE: # t= sym; cmpl $-39,%eax je _208 cmpl $-2,%eax je _208 cmpl $-1,%eax je _208 cmpl $-37,%eax jne _209 _208: movl sym,%eax movl %eax,-16(%ebp) # getsym(); call getsym # break; jmp _207 # case STRUCT: # case UNION: # t=sdecl(sym); _209: cmpl $-7,%eax je _210 cmpl $-6,%eax jne _211 _210: movl sym,%eax pushl %eax call sdecl addl $4,%esp movl %eax,-16(%ebp) # break; jmp _207 # case UNSIGNED: # t = UNSIGNED; _211: cmpl $-3,%eax jne _213 _212: movl $-3,%eax movl %eax,-16(%ebp) # if(getsym()==INT) getsym(); movl $-1,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _214 call getsym # break; _214: jmp _207 # case SHORT: # t=CHAR; _213: cmpl $-35,%eax jne _216 _215: movl $-2,%eax movl %eax,-16(%ebp) # if(getsym()==INT) getsym(); movl $-1,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _217 call getsym # break; _217: jmp _207 # case LONG: # t=INT; _216: cmpl $-34,%eax jne _219 _218: movl $-1,%eax movl %eax,-16(%ebp) # if(getsym()==INT) getsym(); movl $-1,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _220 call getsym # break; _220: jmp _207 # default: # if(sym==IDENT) { _221: movl $-26,%eax movl sym,%ecx subl %eax,%ecx jne _222 # if(nptr->sc==TYPE) { movl $-33,%ecx movl $4,%eax movl nptr,%edx addl %eax,%edx movl (%edx),%edx subl %ecx,%edx jne _223 # t=nptr->ty; movl $8,%edx movl nptr,%ecx addl %edx,%ecx movl (%ecx),%ecx movl %ecx,-16(%ebp) # getsym(); call getsym # break; jmp _207 # } else if(nptr->sc==EMPTY && gnptr->sc==TYPE) { _223: movl $-9,%eax movl $4,%ecx movl nptr,%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _224 movl $-33,%edx movl $4,%eax movl gnptr,%ecx addl %eax,%ecx movl (%ecx),%ecx subl %edx,%ecx jne _224 # t=gnptr->ty; movl $8,%ecx movl gnptr,%eax addl %ecx,%eax movl (%eax),%eax movl %eax,-16(%ebp) # getsym(); call getsym # break; jmp _207 # } # } _224: # if(mode==LDECL) return 0; _222: movl $5,%eax movl mode,%ecx subl %eax,%ecx jne _225 movl $0,%ecx # t= INT; movl %ecx,%eax jmp _206 _225: movl $-1,%eax movl %eax,-16(%ebp) # } # return t; jmp _226 _219: jmp _221 _226: _207: movl -16(%ebp),%eax # } _206: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _227: .size typespec,_227-typespec # # struct nametable * # decl0(void) # decl0 # 425 # { .align 2 .globl decl0 decl0: .type decl0,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *n; # if(sym==MUL) { subl $4,%esp movl $24,%eax movl sym,%ecx subl %eax,%ecx jne _229 # getsym(); call getsym # n=decl0(); call decl0 movl %eax,-16(%ebp) # type=list2(POINTER,type); movl type,%eax pushl %eax movl $-4,%eax pushl %eax call list2 addl $8,%esp movl %eax,type # return n; movl -16(%ebp),%eax # } jmp _228 # return decl1(); _229: call decl1 # } _228: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _230: .size decl0,_230-decl0 # # # NMTBL * # decl1(void) # decl1 # 432 # { .align 2 .globl decl1 decl1: .type decl1,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *n; # int i,t; # # if(sym==LPAR) { subl $12,%esp movl $57,%eax movl sym,%ecx subl %eax,%ecx jne _232 # getsym(); call getsym # n=decl0(); call decl0 movl %eax,-16(%ebp) # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # } else if (sym == IDENT) { jmp _233 _232: movl $-26,%eax movl sym,%ecx subl %eax,%ecx jne _234 # n=nptr; movl nptr,%ecx movl %ecx,-16(%ebp) # getsym(); call getsym # } else { jmp _235 _234: # /* error(DCERR); */ # n= &null_nptr; movl $null_nptr,%eax movl %eax,-16(%ebp) # } # while(1) { _235: _233: _237: # if(sym==LBRA) { movl $59,%eax movl sym,%ecx subl %eax,%ecx jne _238 # if(getsym()==RBRA) { movl $60,%ecx call getsym subl %ecx,%eax jne _239 # getsym(); call getsym # if(mode==ADECL) { movl $4,%eax movl mode,%ecx subl %eax,%ecx jne _240 # t=type; movl type,%ecx movl %ecx,-24(%ebp) # type=list2(POINTER,type); movl type,%ecx pushl %ecx movl $-4,%ecx pushl %ecx call list2 addl $8,%esp movl %eax,type # } else if (mode==GDECL) { jmp _241 _240: movl $1,%eax movl mode,%ecx subl %eax,%ecx jne _242 # t=type; movl type,%ecx movl %ecx,-24(%ebp) # type=list3(ARRAY,t,0); movl $0,%ecx pushl %ecx movl -24(%ebp),%ecx pushl %ecx movl $-5,%ecx pushl %ecx call list3 addl $12,%esp movl %eax,type # } else { jmp _243 _242: # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # } # } else { _243: _241: jmp _244 _239: # t=type; movl type,%eax movl %eax,-24(%ebp) # i=cexpr(expr()); call expr pushl %eax call cexpr addl $4,%esp movl %eax,-20(%ebp) # checksym(RBRA); movl $60,%eax pushl %eax call checksym addl $4,%esp # type=list3(ARRAY,t,i); movl -20(%ebp),%eax pushl %eax movl -24(%ebp),%eax pushl %eax movl $-5,%eax pushl %eax call list3 addl $12,%esp movl %eax,type # } # } else if(sym==LPAR) { _244: jmp _245 _238: movl $57,%eax movl sym,%ecx subl %eax,%ecx jne _246 # if(mode==GDECL) { movl $1,%ecx movl mode,%eax subl %ecx,%eax jne _247 # mode=ADECL;getsym();mode=GDECL; /* ??? */ movl $4,%eax movl %eax,mode call getsym movl $1,%eax movl %eax,mode # } else jmp _248 _247: # getsym(); call getsym # if(sym==RPAR) _248: movl $58,%eax movl sym,%ecx subl %eax,%ecx jne _249 # getsym(); call getsym # else { jmp _250 _249: # if (type==CODE) { movl $-39,%eax movl type,%ecx subl %eax,%ecx jne _251 # n->sc=CODE; movl $-39,%ecx movl $4,%eax movl -16(%ebp),%edx addl %eax,%edx movl %ecx,(%edx) movl %ecx,%edx # n->dsp=0; movl $0,%edx movl $12,%ecx movl -16(%ebp),%eax addl %ecx,%eax movl %edx,(%eax) movl %edx,%eax # stmode=REGISTER; movl $-38,%eax movl %eax,stmode # adecl(n); movl -16(%ebp),%eax pushl %eax call adecl addl $4,%esp # stmode=0; movl $0,%eax movl %eax,stmode # n->sc=EMPTY; movl $-9,%eax movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # type=list3(CODE,type,cadr(n->ty)); movl $8,%edx movl -16(%ebp),%ecx addl %edx,%ecx movl (%ecx),%ecx pushl %ecx call cadr addl $4,%esp pushl %eax movl type,%eax pushl %eax movl $-39,%eax pushl %eax call list3 addl $12,%esp movl %eax,type # return n; movl -16(%ebp),%eax # } else { jmp _231 _251: # n->sc=FUNCTION; movl $-8,%eax movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # n->dsp=0; movl $0,%edx movl $12,%eax movl -16(%ebp),%ecx addl %eax,%ecx movl %edx,(%ecx) movl %edx,%ecx # adecl(n); movl -16(%ebp),%ecx pushl %ecx call adecl addl $4,%esp # n->sc=EMPTY; movl $-9,%eax movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # } # } # type=list3(FUNCTION,type,cadr(n->ty)); _250: movl $8,%edx movl -16(%ebp),%ecx addl %edx,%ecx movl (%ecx),%ecx pushl %ecx call cadr addl $4,%esp pushl %eax movl type,%eax pushl %eax movl $-8,%eax pushl %eax call list3 addl $12,%esp movl %eax,type # } else jmp _252 _246: # return n; movl -16(%ebp),%eax # } jmp _231 _252: _245: # } jmp _237 _236: _231: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _253: .size decl1,_253-decl1 # # # void # adecl(NMTBL *n) # adecl # 479 # { .align 2 .globl adecl adecl: .type adecl,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *arg,*sfnptr; # int sreg_var,t; # int stype; # # stype=type; subl $20,%esp movl type,%eax movl %eax,-32(%ebp) # sfnptr=fnptr; movl fnptr,%eax movl %eax,-20(%ebp) # fnptr=n; movl 8(%ebp),%eax movl %eax,fnptr # sreg_var=reg_var; movl reg_var,%eax movl %eax,-24(%ebp) # reg_var=0; movl $0,%eax movl %eax,reg_var # n->dsp=0; movl $0,%eax movl $12,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # if(mode!=GDECL && mode!=ADECL) error(DCERR); movl $1,%edx movl mode,%eax subl %edx,%eax je _255 movl $4,%eax movl mode,%ecx subl %eax,%ecx je _255 movl $2,%ecx pushl %ecx call error addl $4,%esp # mode=ADECL; _255: movl $4,%eax movl %eax,mode # args= 0; movl $0,%eax movl %eax,args # printf("# %s\n",n->nm); movl 8(%ebp),%eax movl (%eax),%eax pushl %eax .section .rodata _256: .string "# %s\n" .text lea _256,%eax pushl %eax call printf addl $8,%esp # for(;;) { _258: # if(sym==IDENT && nptr->sc!=TYPE) { movl $-26,%eax movl sym,%ecx subl %eax,%ecx jne _259 movl $-33,%ecx movl $4,%eax movl nptr,%edx addl %eax,%edx movl (%edx),%edx subl %ecx,%edx je _259 # printf("# %d\n",n->ty); movl $8,%edx movl 8(%ebp),%ecx addl %edx,%ecx movl (%ecx),%ecx pushl %ecx .section .rodata _260: .string "# %d\n" .text lea _260,%ecx pushl %ecx call printf addl $8,%esp # rplacad(n->ty,list2(INT,cadr(n->ty))); movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call cadr addl $4,%esp pushl %eax movl $-1,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call rplacad addl $8,%esp # if (stmode==REGISTER && reg_var < MAX_REGISTER_VAR) { movl $-38,%eax movl stmode,%ecx subl %eax,%ecx jne _261 movl MAX_REGISTER_VAR,%ecx movl reg_var,%eax subl %ecx,%eax jge _261 # nptr->ty = INT; movl $-1,%eax movl $8,%ecx movl nptr,%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # nptr->sc = REGISTER; movl $-38,%edx movl $4,%eax movl nptr,%ecx addl %eax,%ecx movl %edx,(%ecx) movl %edx,%ecx # if ((nptr->dsp = get_register_var())<0) movl $0,%ecx call get_register_var movl $12,%edx pushl %edx movl nptr,%edx popl %ebx addl %ebx,%edx movl %eax,(%edx) movl %eax,%edx subl %ecx,%edx jge _262 # error(-1); movl $-1,%edx pushl %edx call error addl $4,%esp # reg_var++; _262: movl $reg_var,%eax movl (%eax),%edx addl $1,(%eax) # } else { jmp _263 _261: # nptr->ty = INT; movl $-1,%edx movl $8,%ecx movl nptr,%eax addl %ecx,%eax movl %edx,(%eax) movl %edx,%eax # nptr->sc = LVAR; movl $4,%eax movl $4,%edx movl nptr,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # nptr->dsp = args ; movl args,%ecx movl $12,%edx movl nptr,%eax addl %edx,%eax movl %ecx,(%eax) movl %ecx,%eax # args += int_size; movl int_size,%eax movl $args,%edx pushl %edx # assop movl (%edx),%edx addl %eax,%edx popl %ebx # assop movl %edx,(%ebx) # } # getsym(); _263: call getsym # if(sym==RPAR) break; movl $58,%eax movl sym,%ecx subl %eax,%ecx jne _264 jmp _257 # } else { _264: jmp _265 _259: # if(sym==DOTS) { movl $69,%ecx movl sym,%eax subl %ecx,%eax jne _266 # printf("# %d\n",n->ty); movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx .section .rodata _267: .string "# %d\n" .text lea _267,%ecx pushl %ecx call printf addl $8,%esp # rplacad(n->ty,list2(INT,cadr(n->ty))); movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call cadr addl $4,%esp pushl %eax movl $-1,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call rplacad addl $8,%esp # getsym(); call getsym # break; jmp _257 # } # if((t=typespec())==0) { _266: movl $0,%eax xchg %ecx,%eax call typespec movl %eax,-28(%ebp) subl %ecx,%eax jne _268 # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # break; jmp _257 # } # if(sym!=COMMA && sym!=RPAR) { _268: movl $56,%eax movl sym,%ecx subl %eax,%ecx je _269 movl $58,%ecx movl sym,%eax subl %ecx,%eax je _269 # if(sym==RPAR) break; movl $58,%eax movl sym,%ecx subl %eax,%ecx jne _270 jmp _257 # type=t; _270: movl -28(%ebp),%ecx movl %ecx,type # arg=decl0(); call decl0 movl %eax,-16(%ebp) # reverse(t); movl -28(%ebp),%eax pushl %eax call reverse addl $4,%esp # if (arg != &null_nptr) { /* no varname typespec only */ movl $null_nptr,%eax movl -16(%ebp),%ecx subl %eax,%ecx je _271 # def(arg); movl -16(%ebp),%ecx pushl %ecx call def addl $4,%esp # } # } _271: # printf("# %d\n",n->ty); _269: movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx .section .rodata _272: .string "# %d\n" .text lea _272,%ecx pushl %ecx call printf addl $8,%esp # rplacad(n->ty,list2(INT,cadr(n->ty))); movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call cadr addl $4,%esp pushl %eax movl $-1,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call rplacad addl $8,%esp # if(sym==RPAR) break; movl $58,%eax movl sym,%ecx subl %eax,%ecx jne _273 jmp _257 # } _273: # if (sym!=COMMA) error(DCERR); _265: movl $56,%ecx movl sym,%eax subl %ecx,%eax je _274 movl $2,%eax pushl %eax call error addl $4,%esp # getsym(); _274: call getsym # } # checksym(RPAR); jmp _258 _257: movl $58,%eax pushl %eax call checksym addl $4,%esp # mode=GDECL; movl $1,%eax movl %eax,mode # reg_var=sreg_var; movl -24(%ebp),%eax movl %eax,reg_var # fnptr=sfnptr; movl -20(%ebp),%eax movl %eax,fnptr # type=stype; movl -32(%ebp),%eax movl %eax,type # return; # } _254: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _275: .size adecl,_275-adecl # # void # reverse(int t1) # reverse # 799 # { .align 2 .globl reverse reverse: .type reverse,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t2,t3; # t2=t1; subl $8,%esp movl 8(%ebp),%eax movl %eax,-16(%ebp) # # while(type!=t1) { _278: movl 8(%ebp),%eax movl type,%ecx subl %eax,%ecx je _277 # t3=cadr(type); movl type,%ecx pushl %ecx call cadr addl $4,%esp movl %eax,-20(%ebp) # rplacad(type,t2); movl -16(%ebp),%eax pushl %eax movl type,%eax pushl %eax call rplacad addl $8,%esp # t2=type; movl type,%eax movl %eax,-16(%ebp) # type=t3; movl -20(%ebp),%eax movl %eax,type # } # type = t2; jmp _278 _277: movl -16(%ebp),%eax movl %eax,type # } _276: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _279: .size reverse,_279-reverse # # int # reverse0(int t1) # reverse0 # 804 # { .align 2 .globl reverse0 reverse0: .type reverse0,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t2,t3; # # t2=0; subl $8,%esp movl $0,%eax movl %eax,-16(%ebp) # while(t1) { _282: cmpl $0,8(%ebp) je _281 # t3=cadr(t1); movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-20(%ebp) # rplacad(t1,t2); movl -16(%ebp),%eax pushl %eax movl 8(%ebp),%eax pushl %eax call rplacad addl $8,%esp # t2=t1; movl 8(%ebp),%eax movl %eax,-16(%ebp) # t1=t3; movl -20(%ebp),%eax movl %eax,8(%ebp) # } # return t2; jmp _282 _281: movl -16(%ebp),%eax # } _280: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _283: .size reverse0,_283-reverse0 # # int # size(int t) # size # 0 # { .align 2 .globl size size: .type size,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(t==CHAR) return 1; movl $-2,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _285 movl $1,%ecx # if(t==VOID) return 0; movl %ecx,%eax jmp _284 _285: movl $-37,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _286 movl $0,%ecx # if(scalar(t)) return int_size; movl %ecx,%eax jmp _284 _286: movl 8(%ebp),%eax pushl %eax call scalar addl $4,%esp cmpl $0,%eax je _287 movl int_size,%eax # if(car(t)==STRUCT||car(t)==UNION) { jmp _284 _287: movl $-6,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _289 movl $-7,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _288 _289: # if(cadr(t)==-1) error(DCERR); movl $-1,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp subl %ecx,%eax jne _290 movl $2,%eax pushl %eax call error addl $4,%esp # return(cadr(t)); _290: movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp # } jmp _284 # if(car(t)==ARRAY) _288: movl $-5,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _291 # return(size(cadr(t))*caddr(t)); movl 8(%ebp),%eax pushl %eax call caddr addl $4,%esp movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp imull %ecx,%eax # else jmp _284 _291: # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # return 0; movl $0,%eax # } _284: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _292: .size size,_292-size # # void # def(NMTBL *n) # def # 524 # { .align 2 .globl def def: .type def,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int sz,nsc,ndsp,slfree,t,e; # char *p; # # nsc=ndsp=0; subl $28,%esp movl $0,%eax movl %eax,-24(%ebp) movl %eax,-20(%ebp) # if(car(type)==FUNCTION) { movl $-8,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _294 # fcheck(n); movl 8(%ebp),%eax pushl %eax call fcheck addl $4,%esp # return; # } jmp _293 # if (n->sc!=EMPTY && _294: # !(n->sc==GVAR&&n->dsp==EXTRN) && # !(n->sc==FUNCTION&&n->dsp==EXTRN) && # (mode!=ADECL || n->sc!=LVAR || n->ty!=INT) && # (mode!=ADECL || n->sc!=REGISTER || n->ty!=INT) && # ((mode!=GSDECL&&mode!=LSDECL) || n->sc!=FIELD || n->dsp!=disp) && # ((mode!=GUDECL&&mode!=LUDECL) || n->sc!=FIELD || n->dsp!=0) ) movl $-9,%eax movl $4,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _295 movl $1,%edx movl $4,%ecx movl 8(%ebp),%eax addl %ecx,%eax movl (%eax),%eax subl %edx,%eax jne _296 movl $-36,%eax movl $12,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _295 _296: movl $-8,%edx movl $4,%ecx movl 8(%ebp),%eax addl %ecx,%eax movl (%eax),%eax subl %edx,%eax jne _297 movl $-36,%eax movl $12,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _295 _297: movl $4,%edx movl mode,%ecx subl %edx,%ecx jne _298 movl $4,%ecx movl $4,%eax movl 8(%ebp),%edx addl %eax,%edx movl (%edx),%edx subl %ecx,%edx jne _298 movl $-1,%edx movl $8,%ecx movl 8(%ebp),%eax addl %ecx,%eax movl (%eax),%eax subl %edx,%eax je _295 _298: movl $4,%eax movl mode,%ecx subl %eax,%ecx jne _299 movl $-38,%ecx movl $4,%eax movl 8(%ebp),%edx addl %eax,%edx movl (%edx),%edx subl %ecx,%edx jne _299 movl $-1,%edx movl $8,%ecx movl 8(%ebp),%eax addl %ecx,%eax movl (%eax),%eax subl %edx,%eax je _295 _299: movl $2,%eax movl mode,%ecx subl %eax,%ecx je _301 movl $6,%ecx movl mode,%eax subl %ecx,%eax jne _300 _301: movl $-25,%eax movl $4,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _300 movl disp,%edx movl $12,%ecx movl 8(%ebp),%eax addl %ecx,%eax movl (%eax),%eax subl %edx,%eax je _295 _300: movl $3,%eax movl mode,%ecx subl %eax,%ecx je _303 movl $7,%ecx movl mode,%eax subl %ecx,%eax jne _302 _303: movl $-25,%eax movl $4,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _302 movl $0,%edx movl $12,%ecx movl 8(%ebp),%eax addl %ecx,%eax movl (%eax),%eax subl %edx,%eax je _295 _302: # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # sz = size(n->ty = type); _295: movl type,%eax movl $8,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx pushl %edx call size addl $4,%esp movl %eax,-16(%ebp) # switch(mode) { movl mode,%eax # case GDECL: # gen_gdecl(n->nm,gpc); cmpl $1,%eax jne _306 _305: movl gpc,%eax pushl %eax movl 8(%ebp),%eax movl (%eax),%eax pushl %eax call gen_gdecl addl $8,%esp # case STADECL: # nsc = GVAR; jmp _307 _306: cmpl $8,%eax jne _308 _307: movl $1,%eax movl %eax,-20(%ebp) # ndsp = gpc; movl gpc,%eax movl %eax,-24(%ebp) # if (stmode==EXTRN) movl $-36,%eax movl stmode,%ecx subl %eax,%ecx jne _309 # n->dsp = EXTRN; movl $-36,%ecx movl $12,%edx movl 8(%ebp),%eax addl %edx,%eax movl %ecx,(%eax) movl %ecx,%eax # else jmp _310 _309: # n->dsp = ndsp; /* emit_data will override this */ movl -24(%ebp),%eax movl $12,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # n->sc = nsc; _310: movl -20(%ebp),%edx movl $4,%ecx movl 8(%ebp),%eax addl %ecx,%eax movl %edx,(%eax) movl %edx,%eax # if (stmode==LDECL) { movl $5,%eax movl stmode,%ecx subl %eax,%ecx jne _311 # copy(n,n->nm); movl 8(%ebp),%ecx movl (%ecx),%ecx pushl %ecx movl 8(%ebp),%ecx pushl %ecx call copy addl $8,%esp # cheapp[-1] = '.'; movl $46,%eax movl $-1,%edx movl cheapp,%ecx addl %edx,%ecx movb %eax,(%ecx) movl %eax,%ecx # ndsp = ++stat_no; movl $stat_no,%ecx addl $1,(%ecx) movl (%ecx),%ecx movl %ecx,-24(%ebp) # while(ndsp>0) { _313: movl $0,%ecx movl -24(%ebp),%eax subl %ecx,%eax jle _312 # *cheapp++ = ndsp%10+'0'; movl $48,%eax movl $10,%edx movl -24(%ebp),%ecx xchg %ecx,%eax xchg %ebx,%edx xor %edx,%edx idivl %ebx addl %ecx,%edx movl $cheapp,%ecx movl (%ecx),%ebx addl $1,(%ecx) movb %edx,(%ebx) movl %edx,%ebx # ndsp /= 10; movl $10,%ebx lea -24(%ebp),%ecx pushl %ecx # assop movl (%ecx),%ecx xchg %ecx,%eax cltd divl %ebx popl %edx # assop movl %eax,(%edx) # } # *cheapp++ = 0; jmp _313 _312: movl $0,%eax movl $cheapp,%ebx movl (%ebx),%ecx addl $1,(%ebx) movb %eax,(%ecx) movl %eax,%ecx # } # if(sym==ASS) { _311: movl $52,%ecx movl sym,%eax subl %ecx,%eax jne _314 # decl_data(type,n); movl 8(%ebp),%eax pushl %eax movl type,%eax pushl %eax call decl_data addl $8,%esp # emit_data_closing(n); movl 8(%ebp),%eax pushl %eax call emit_data_closing addl $4,%esp # /* gpc is incremented by emit_data */ # } else jmp _315 _314: # gpc +=sz; movl -16(%ebp),%eax movl $gpc,%ebx pushl %ebx # assop movl (%ebx),%ebx addl %eax,%ebx popl %edx # assop movl %ebx,(%edx) # return; _315: # case GSDECL: movl %ebx,%eax jmp _293 # nsc = FIELD; _308: cmpl $2,%eax jne _317 _316: movl $-25,%eax movl %eax,-20(%ebp) # ndsp = disp; movl disp,%eax movl %eax,-24(%ebp) # disp += sz; movl -16(%ebp),%eax movl $disp,%ebx pushl %ebx # assop movl (%ebx),%ebx addl %eax,%ebx popl %edx # assop movl %ebx,(%edx) # break; jmp _304 # case GUDECL: # nsc = FIELD; _317: cmpl $3,%eax jne _319 _318: movl $-25,%eax movl %eax,-20(%ebp) # ndsp = 0; movl $0,%eax movl %eax,-24(%ebp) # if (disp < sz) disp = sz; movl -16(%ebp),%eax movl disp,%ebx subl %eax,%ebx jge _320 movl -16(%ebp),%ebx movl %ebx,disp # break; _320: jmp _304 # case GTDECL: # nsc = TYPE; _319: cmpl $10,%eax jne _322 _321: movl $-33,%eax movl %eax,-20(%ebp) # break; jmp _304 # case ADECL: # if (stmode==REGISTER && reg_var <MAX_REGISTER_VAR) { _322: cmpl $4,%eax jne _324 _323: movl $-38,%eax movl stmode,%ebx subl %eax,%ebx jne _325 movl MAX_REGISTER_VAR,%ebx movl reg_var,%eax subl %ebx,%eax jge _325 # if (type!=CHAR && !scalar(type)) movl $-2,%eax movl type,%ebx subl %eax,%ebx je _326 movl type,%ebx pushl %ebx call scalar addl $4,%esp cmpl $0,%eax jne _326 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # nsc = REGISTER; _326: movl $-38,%eax movl %eax,-20(%ebp) # reg_var++; movl $reg_var,%eax movl (%eax),%ebx addl $1,(%eax) # ndsp = get_register_var(); call get_register_var movl %eax,-24(%ebp) # break; jmp _304 # } # nptr->sc = LVAR; _325: movl $4,%eax movl $4,%ebx movl nptr,%ecx addl %ebx,%ecx movl %eax,(%ecx) movl %eax,%ecx # if(type==CHAR) { movl $-2,%ecx movl type,%ebx subl %ecx,%ebx jne _327 # /* nptr->ty=INT; */ # if (nptr->dsp==0) { movl $0,%ebx movl $12,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx subl %ebx,%ecx jne _328 # nptr->dsp = args; movl args,%ecx movl $12,%ebx movl nptr,%eax addl %ebx,%eax movl %ecx,(%eax) movl %ecx,%eax # if (endian) cmpl $0,endian je _329 # n->dsp += int_size-1; movl $1,%eax movl int_size,%ebx subl %eax,%ebx movl $12,%eax movl 8(%ebp),%ecx addl %eax,%ecx pushl %ecx # assop movl (%ecx),%ecx addl %ebx,%ecx popl %edx # assop movl %ecx,(%edx) # } _329: # args += int_size; _328: movl int_size,%ecx movl $args,%ebx pushl %ebx # assop movl (%ebx),%ebx addl %ecx,%ebx popl %edx # assop movl %ebx,(%edx) # } else { jmp _330 _327: # if (nptr->dsp==0) movl $0,%ebx movl $12,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx subl %ebx,%ecx jne _331 # nptr->dsp = args; movl args,%ecx movl $12,%ebx movl nptr,%eax addl %ebx,%eax movl %ecx,(%eax) movl %ecx,%eax # args += sz; _331: movl -16(%ebp),%eax movl $args,%ebx pushl %ebx # assop movl (%ebx),%ebx addl %eax,%ebx popl %edx # assop movl %ebx,(%edx) # } # if(type==VOID) { _330: movl $-37,%ebx movl type,%eax subl %ebx,%eax jne _332 # } else if (!scalar(type)) { jmp _333 _332: movl type,%eax pushl %eax call scalar addl $4,%esp cmpl $0,%eax jne _334 # if((t=car(type))==STRUCT || t==UNION) { movl $-6,%eax movl type,%ebx pushl %ebx xchg %ebx,%eax call car addl $4,%esp movl %eax,-32(%ebp) subl %ebx,%eax je _336 movl $-7,%eax movl -32(%ebp),%ebx subl %eax,%ebx jne _335 _336: # nptr->ty = type; movl type,%ebx movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl %ebx,(%ecx) movl %ebx,%ecx # } else jmp _337 _335: # error(TYERR); movl $15,%ecx pushl %ecx call error addl $4,%esp # } _337: # return; _334: _333: # case LDECL: jmp _293 # if (stmode==REGISTER && reg_var <=MAX_REGISTER_VAR) { _324: cmpl $5,%eax jne _339 _338: movl $-38,%eax movl stmode,%ecx subl %eax,%ecx jne _340 movl MAX_REGISTER_VAR,%ecx movl reg_var,%ebx subl %ecx,%ebx jg _340 # if(!scalar(type)) /* non integer register type ... */ movl type,%ebx pushl %ebx call scalar addl $4,%esp cmpl $0,%eax jne _341 # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # nsc = REGISTER; _341: movl $-38,%eax movl %eax,-20(%ebp) # reg_var++; movl $reg_var,%eax movl (%eax),%ecx addl $1,(%eax) # ndsp = get_register_var(); call get_register_var movl %eax,-24(%ebp) # } else { jmp _342 _340: # nsc = LVAR; movl $4,%eax movl %eax,-20(%ebp) # ndsp = (disp -= sz); movl -16(%ebp),%eax movl $disp,%ecx pushl %ecx # assop movl (%ecx),%ecx subl %eax,%ecx popl %edx # assop movl %ecx,(%edx) movl %ecx,-24(%ebp) # } # if(sym==ASS) { _342: movl $52,%ecx movl sym,%eax subl %ecx,%eax jne _343 # decl_data(type,n); movl 8(%ebp),%eax pushl %eax movl type,%eax pushl %eax call decl_data addl $8,%esp # } # break; _343: jmp _304 # case LSDECL: # nsc = FIELD; _339: cmpl $6,%eax jne _345 _344: movl $-25,%eax movl %eax,-20(%ebp) # ndsp = disp; movl disp,%eax movl %eax,-24(%ebp) # disp += sz; movl -16(%ebp),%eax movl $disp,%ecx pushl %ecx # assop movl (%ecx),%ecx addl %eax,%ecx popl %edx # assop movl %ecx,(%edx) # break; jmp _304 # case LUDECL: # nsc = FIELD; _345: cmpl $7,%eax jne _347 _346: movl $-25,%eax movl %eax,-20(%ebp) # ndsp = 0; movl $0,%eax movl %eax,-24(%ebp) # if (disp < sz) disp = sz; movl -16(%ebp),%eax movl disp,%ecx subl %eax,%ecx jge _348 movl -16(%ebp),%ecx movl %ecx,disp # break; _348: jmp _304 # case LTDECL: # nsc = TYPE; _347: cmpl $11,%eax jne _350 _349: movl $-33,%eax movl %eax,-20(%ebp) # break; jmp _304 # default: # error(DCERR); _351: movl $2,%eax pushl %eax call error addl $4,%esp # } # n->sc = nsc; jmp _352 _350: jmp _351 _352: _304: movl -20(%ebp),%eax movl $4,%ecx movl 8(%ebp),%ebx addl %ecx,%ebx movl %eax,(%ebx) movl %eax,%ebx # if (stmode==EXTRN) movl $-36,%ebx movl stmode,%eax subl %ebx,%eax jne _353 # n->dsp = EXTRN; movl $-36,%eax movl $12,%ecx movl 8(%ebp),%ebx addl %ecx,%ebx movl %eax,(%ebx) movl %eax,%ebx # else jmp _354 _353: # n->dsp = ndsp; movl -24(%ebp),%ebx movl $12,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl %ebx,(%ecx) movl %ebx,%ecx # } _354: movl %ecx,%eax _293: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _355: .size def,_355-def # # void # emit_init_vars(void) # emit_init_vars # 0 # { .align 2 .globl emit_init_vars emit_init_vars: .type emit_init_vars,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # while(init_vars) { _358: cmpl $0,init_vars je _357 # g_expr(car(init_vars)); movl init_vars,%eax pushl %eax call car addl $4,%esp pushl %eax call g_expr addl $4,%esp # init_vars = cadr(init_vars); movl init_vars,%eax pushl %eax call cadr addl $4,%esp movl %eax,init_vars # } # } jmp _358 _357: _356: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _359: .size emit_init_vars,_359-emit_init_vars # # void # assign_data(int e, int t, int n) # assign_data # 0 # 0 # 0 # { .align 2 .globl assign_data assign_data: .type assign_data,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int ass; # # if(mode==GDECL) { subl $4,%esp movl $1,%eax movl mode,%ecx subl %eax,%ecx jne _361 # emit_data(e,t,(NMTBL *)n); movl 16(%ebp),%ecx pushl %ecx movl 12(%ebp),%ecx pushl %ecx movl 8(%ebp),%ecx pushl %ecx call emit_data addl $12,%esp # } else if(mode==LDECL) { jmp _362 _361: movl $5,%eax movl mode,%ecx subl %eax,%ecx jne _363 # if (t==STRUCT || t==UNION) { movl $-6,%ecx movl 12(%ebp),%eax subl %ecx,%eax je _365 movl $-7,%eax movl 12(%ebp),%ecx subl %eax,%ecx jne _364 _365: # ass = list3(SASS,list2(LVAR,nptr->dsp),e); movl 8(%ebp),%ecx pushl %ecx movl $12,%ecx movl nptr,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax movl $4,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl $68,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # } else { jmp _366 _364: # if(t==CHAR) { movl $-2,%eax movl 12(%ebp),%ecx subl %eax,%ecx jne _367 # ass =list3(CASS,list2(LVAR,nptr->dsp),e); movl 8(%ebp),%ecx pushl %ecx movl $12,%ecx movl nptr,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax movl $4,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl $53,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # } else { jmp _368 _367: # ass = list3(ASS,list2(LVAR,nptr->dsp),e); movl 8(%ebp),%eax pushl %eax movl $12,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx movl $4,%ecx pushl %ecx call list2 addl $8,%esp pushl %eax movl $52,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # } # } _368: # init_vars = list2(ass,init_vars); _366: movl init_vars,%eax pushl %eax movl -16(%ebp),%eax pushl %eax call list2 addl $8,%esp movl %eax,init_vars # } else { jmp _369 _363: # error(DCERR); movl $2,%eax pushl %eax call error addl $4,%esp # } # } _369: _362: _360: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _370: .size assign_data,_370-assign_data # # void # decl_data(int t, NMTBL *n) # decl_data # 484 # 484 # /* type */ # # { .align 2 .globl decl_data decl_data: .type decl_data,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t1,slfree,e,i; # # getsym(); subl $16,%esp call getsym # if (scalar(t)) { movl 8(%ebp),%eax pushl %eax call scalar addl $4,%esp cmpl $0,%eax je _372 # slfree=lfree; movl lfree,%eax movl %eax,-20(%ebp) # e=expr1(); call expr1 movl %eax,-24(%ebp) # if(car(e)!=CONST && t==CHAR) movl $7,%eax movl -24(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _373 movl $-2,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _373 # error(TYERR); movl $15,%ecx pushl %ecx call error addl $4,%esp # emit_data(e,t,n); _373: movl 12(%ebp),%eax pushl %eax movl 8(%ebp),%eax pushl %eax movl -24(%ebp),%eax pushl %eax call emit_data addl $12,%esp # lfree=slfree; movl -20(%ebp),%eax movl %eax,lfree # type=t; movl 8(%ebp),%eax movl %eax,type # return; # } jmp _371 # t1 = car(t); _372: movl 8(%ebp),%eax pushl %eax call car addl $4,%esp movl %eax,-16(%ebp) # if (t1==ARRAY) { movl $-5,%eax movl -16(%ebp),%ecx subl %eax,%ecx jne _374 # if (sym==LC) { movl $61,%ecx movl sym,%eax subl %ecx,%eax jne _375 # t1 = cadr(t); movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-16(%ebp) # for(i=0;;i++) { movl $0,%eax movl %eax,-28(%ebp) _377: # if (sym!=RC) movl $62,%eax movl sym,%ecx subl %eax,%ecx je _379 # decl_data(t1,n); movl 12(%ebp),%ecx pushl %ecx movl -16(%ebp),%ecx pushl %ecx call decl_data addl $8,%esp # if (sym==COMMA) { continue; _379: movl $56,%eax movl sym,%ecx subl %eax,%ecx jne _380 jmp _378 # } else if (sym==RC) { _380: movl $62,%ecx movl sym,%eax subl %ecx,%eax jne _381 # if (caddr(t)==0) { movl $0,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call caddr addl $4,%esp subl %ecx,%eax jne _382 # heap[t+2]=i; movl -28(%ebp),%eax movl $4,%ecx movl $2,%edx pushl %edx movl 8(%ebp),%edx popl %ebx addl %ebx,%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # } else if (caddr(t)!=i+1) { jmp _383 _382: movl $1,%ecx movl -28(%ebp),%eax addl %ecx,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call caddr addl $4,%esp subl %ecx,%eax je _384 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # } # getsym(); _384: _383: call getsym # return; # } else { jmp _371 _381: # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # } # } # } else if (cadr(t)==CHAR) { _378: lea -28(%ebp),%eax movl (%eax),%ecx addl $1,(%eax) jmp _377 _376: jmp _385 _375: movl $-2,%ecx movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp subl %ecx,%eax jne _386 # slfree=lfree; movl lfree,%eax movl %eax,-20(%ebp) # e=expr1(); call expr1 movl %eax,-24(%ebp) # if(car(e)!=STRING) movl $-27,%eax movl -24(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _387 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # emit_data(e,STRING,n); _387: movl 12(%ebp),%eax pushl %eax movl $-27,%eax pushl %eax movl -24(%ebp),%eax pushl %eax call emit_data addl $12,%esp # heap[t+2]= size(type); movl type,%eax pushl %eax call size addl $4,%esp movl $4,%ecx movl $2,%edx pushl %edx movl 8(%ebp),%edx popl %ebx addl %ebx,%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # lfree=slfree; movl -20(%ebp),%ecx movl %ecx,lfree # } else jmp _388 _386: # error(DCERR); movl $2,%ecx pushl %ecx call error addl $4,%esp # } else if (t1==STRUCT) { _388: _385: jmp _389 _374: movl $-6,%eax movl -16(%ebp),%ecx subl %eax,%ecx jne _390 # if(cadr(t)==-1) error(DCERR); movl $-1,%ecx movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp subl %ecx,%eax jne _391 movl $2,%eax pushl %eax call error addl $4,%esp # t1 = caddr(t); /* list of fields */ _391: movl 8(%ebp),%eax pushl %eax call caddr addl $4,%esp movl %eax,-16(%ebp) # while(t1) { _393: cmpl $0,-16(%ebp) je _392 # decl_data(car(t1),n); /* alignment? */ movl 12(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax call car addl $4,%esp pushl %eax call decl_data addl $8,%esp # t1 = cadr(t1); movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-16(%ebp) # if ( t1 && sym==COMMA) continue; cmpl $0,-16(%ebp) je _394 movl $56,%eax movl sym,%ecx subl %eax,%ecx jne _394 jmp _393 # if (!t1 && sym!=RC) error(DCERR); _394: cmpl $0,-16(%ebp) jne _395 movl $62,%ecx movl sym,%eax subl %ecx,%eax je _395 movl $2,%eax pushl %eax call error addl $4,%esp # } _395: # getsym(); jmp _393 _392: call getsym # return; # } else { jmp _371 _390: # error(TYERR); /* should be initialization error */ movl $15,%eax pushl %eax call error addl $4,%esp # } # } _389: _371: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _396: .size decl_data,_396-decl_data # # int # sdecl(int s) # sdecl # 824 # { .align 2 .globl sdecl sdecl: .type sdecl,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int smode,sdisp,type0,type1; # NMTBL *nptr0,*gnptr0; # int tags; # # smode=mode; subl $28,%esp movl mode,%eax movl %eax,-16(%ebp) # if (mode==GDECL || mode==GSDECL || mode==GUDECL || mode==GTDECL) movl $1,%eax movl mode,%ecx subl %eax,%ecx je _399 movl $2,%ecx movl mode,%eax subl %ecx,%eax je _399 movl $3,%eax movl mode,%ecx subl %eax,%ecx je _399 movl $10,%ecx movl mode,%eax subl %ecx,%eax jne _398 _399: # mode=(s==STRUCT?GSDECL:GUDECL); movl $-6,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _400 movl $2,%ecx jmp _401 _400: movl $3,%ecx _401: movl %ecx,mode # else jmp _402 _398: # mode=(s==STRUCT?LSDECL:LUDECL); movl $-6,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _403 movl $6,%eax jmp _404 _403: movl $7,%eax _404: movl %eax,mode # sdisp=disp; _402: movl disp,%eax movl %eax,-20(%ebp) # disp=0; movl $0,%eax movl %eax,disp # if (getsym() == IDENT) { movl $-26,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _405 # nptr0 = nptr; movl nptr,%eax movl %eax,-32(%ebp) # gnptr0 = gnptr; movl gnptr,%eax movl %eax,-36(%ebp) # if (getsym() == LC) { movl $61,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _406 # if (nptr0->sc != EMPTY) error(DCERR); movl $-9,%eax movl $4,%ecx movl -32(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _407 movl $2,%edx pushl %edx call error addl $4,%esp # nptr0->sc = TAG; _407: movl $-24,%eax movl $4,%edx movl -32(%ebp),%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # tags = 0; movl $0,%ecx movl %ecx,-40(%ebp) # nptr0->ty = list3(s,-1,tags); movl -40(%ebp),%ecx pushl %ecx movl $-1,%ecx pushl %ecx movl 8(%ebp),%ecx pushl %ecx call list3 addl $12,%esp movl $8,%edx movl -32(%ebp),%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # while (getsym() != RC) { _409: movl $62,%ecx call getsym subl %ecx,%eax je _408 # decl(); call decl # tags = list2(type,tags); movl -40(%ebp),%eax pushl %eax movl type,%eax pushl %eax call list2 addl $8,%esp movl %eax,-40(%ebp) # } # getsym(); jmp _409 _408: call getsym # tags=reverse0(tags); movl -40(%ebp),%eax pushl %eax call reverse0 addl $4,%esp movl %eax,-40(%ebp) # heap[nptr0->ty+2]=tags; movl -40(%ebp),%eax movl $4,%edx movl $2,%ecx pushl %ecx movl $8,%ecx pushl %ecx movl -32(%ebp),%ecx popl %ebx addl %ebx,%ecx movl (%ecx),%ecx popl %ebx addl %ebx,%ecx imull %edx,%ecx movl $heap,%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # rplacad(type0 = nptr0->ty,disp); movl disp,%edx pushl %edx movl $8,%edx movl -32(%ebp),%eax addl %edx,%eax movl (%eax),%eax movl %eax,-24(%ebp) pushl %eax call rplacad addl $8,%esp # } else { jmp _410 _406: # if(nptr0->sc == EMPTY) nptr0=gnptr0; movl $-9,%eax movl $4,%edx movl -32(%ebp),%ecx addl %edx,%ecx movl (%ecx),%ecx subl %eax,%ecx jne _411 movl -36(%ebp),%ecx movl %ecx,-32(%ebp) # if(nptr0->sc == EMPTY) error(UDERR); _411: movl $-9,%ecx movl $4,%eax movl -32(%ebp),%edx addl %eax,%edx movl (%edx),%edx subl %ecx,%edx jne _412 movl $17,%edx pushl %edx call error addl $4,%esp # if(nptr0->sc != TAG) error(TYERR); _412: movl $-24,%eax movl $4,%edx movl -32(%ebp),%ecx addl %edx,%ecx movl (%ecx),%ecx subl %eax,%ecx je _413 movl $15,%ecx pushl %ecx call error addl $4,%esp # type0 = nptr0->ty; _413: movl $8,%eax movl -32(%ebp),%edx addl %eax,%edx movl (%edx),%edx movl %edx,-24(%ebp) # } # } else if(sym==LC) { _410: jmp _414 _405: movl $61,%edx movl sym,%ecx subl %edx,%ecx jne _415 # tags = 0; movl $0,%ecx movl %ecx,-40(%ebp) # while(getsym() != RC) { _417: movl $62,%ecx call getsym subl %ecx,%eax je _416 # decl(); call decl # tags = list2(type,tags); movl -40(%ebp),%eax pushl %eax movl type,%eax pushl %eax call list2 addl $8,%esp movl %eax,-40(%ebp) # } # getsym(); jmp _417 _416: call getsym # tags=reverse0(tags); movl -40(%ebp),%eax pushl %eax call reverse0 addl $4,%esp movl %eax,-40(%ebp) # type0 = list3(s,disp,tags); movl -40(%ebp),%eax pushl %eax movl disp,%eax pushl %eax movl 8(%ebp),%eax pushl %eax call list3 addl $12,%esp movl %eax,-24(%ebp) # } # else error(DCERR); jmp _418 _415: movl $2,%eax pushl %eax call error addl $4,%esp # disp=sdisp; _418: _414: movl -20(%ebp),%eax movl %eax,disp # mode=smode; movl -16(%ebp),%eax movl %eax,mode # return type0; movl -24(%ebp),%eax # } _397: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _419: .size sdecl,_419-sdecl # # void # code_decl(NMTBL *n) # code_decl # 864 # { .align 2 .globl code_decl code_decl: .type code_decl,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if (n->sc==EMPTY) n->sc = CODE; movl $-9,%eax movl $4,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _421 movl $-39,%edx movl $4,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl %edx,(%ecx) movl %edx,%ecx # code_enter(n->nm); _421: movl 8(%ebp),%ecx movl (%ecx),%ecx pushl %ecx call code_enter addl $4,%esp # fnptr=n; movl 8(%ebp),%eax movl %eax,fnptr # args= 0; movl $0,%eax movl %eax,args # reg_var=0; movl $0,%eax movl %eax,reg_var # mode=ADECL; movl $4,%eax movl %eax,mode # stmode=REGISTER; movl $-38,%eax movl %eax,stmode # while (sym!=LC) { /* argument declaration !ANSI */ _423: movl $61,%eax movl sym,%ecx subl %eax,%ecx je _422 # decl(); getsym(); call decl call getsym # } # disp=0; jmp _423 _422: movl $0,%eax movl %eax,disp # init_vars=0; movl $0,%eax movl %eax,init_vars # /* local variable declaration */ # stmode=0; movl $0,%eax movl %eax,stmode # mode=STAT; movl $9,%eax movl %eax,mode # init_vars=0; movl $0,%eax movl %eax,init_vars # while (typeid(getsym()) || sym==STATIC || sym==EXTRN || sym==TYPEDEF) { _425: call getsym pushl %eax call typeid addl $4,%esp cmpl $0,%eax jne _426 movl $-10,%eax movl sym,%ecx subl %eax,%ecx je _426 movl $-36,%ecx movl sym,%eax subl %ecx,%eax je _426 movl $-31,%eax movl sym,%ecx subl %eax,%ecx jne _424 _426: # mode=LDECL; movl $5,%ecx movl %ecx,mode # decl(); call decl # mode=STAT; movl $9,%eax movl %eax,mode # } # control=1; jmp _425 _424: movl $1,%eax movl %eax,control # code_enter1(disp); movl disp,%eax pushl %eax call code_enter1 addl $4,%esp # emit_init_vars(); call emit_init_vars # while(sym!=RC) statement(); _428: movl $62,%eax movl sym,%ecx subl %eax,%ecx je _427 call statement # if(control) jmp _428 _427: cmpl $0,control je _429 # error(STERR); movl $3,%eax pushl %eax call error addl $4,%esp # control=0; _429: movl $0,%eax movl %eax,control # code_leave(n->nm); movl 8(%ebp),%eax movl (%eax),%eax pushl %eax call code_leave addl $4,%esp # } _420: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _430: .size code_decl,_430-code_decl # # void # fdecl(NMTBL *n) # fdecl # 699 # { .align 2 .globl fdecl fdecl: .type fdecl,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # enter(n->nm); movl 8(%ebp),%eax movl (%eax),%eax pushl %eax call enter addl $4,%esp # fnptr=n; movl 8(%ebp),%eax movl %eax,fnptr # retlabel=fwdlabel(); call fwdlabel movl %eax,retlabel # retcont = 0; movl $0,%eax movl %eax,retcont # # args=0; movl $0,%eax movl %eax,args # reg_var=0; movl $0,%eax movl %eax,reg_var # fcheck(n); movl 8(%ebp),%eax pushl %eax call fcheck addl $4,%esp # mode=ADECL; movl $4,%eax movl %eax,mode # while (sym!=LC) { /* argument declaration !ANSI */ _433: movl $61,%eax movl sym,%ecx subl %eax,%ecx je _432 # stmode=0; movl $0,%ecx movl %ecx,stmode # decl(); getsym(); call decl call getsym # } # disp=0; jmp _433 _432: movl $0,%eax movl %eax,disp # init_vars=0; movl $0,%eax movl %eax,init_vars # /* local variable declaration */ # mode=STAT; movl $9,%eax movl %eax,mode # while (typeid(getsym()) || sym==STATIC || sym==EXTRN _435: # || sym==REGISTER || sym==TYPEDEF) { call getsym pushl %eax call typeid addl $4,%esp cmpl $0,%eax jne _436 movl $-10,%eax movl sym,%ecx subl %eax,%ecx je _436 movl $-36,%ecx movl sym,%eax subl %ecx,%eax je _436 movl $-38,%eax movl sym,%ecx subl %eax,%ecx je _436 movl $-31,%ecx movl sym,%eax subl %ecx,%eax jne _434 _436: # mode=LDECL; movl $5,%eax movl %eax,mode # stmode=0; movl $0,%eax movl %eax,stmode # decl(); call decl # mode=STAT; movl $9,%eax movl %eax,mode # } # control=1; jmp _435 _434: movl $1,%eax movl %eax,control # enter1(disp); movl disp,%eax pushl %eax call enter1 addl $4,%esp # emit_init_vars(); call emit_init_vars # while(sym!=RC) statement(); _438: movl $62,%eax movl sym,%ecx subl %eax,%ecx je _437 call statement # # leave(control,n->nm); jmp _438 _437: movl 8(%ebp),%eax movl (%eax),%eax pushl %eax movl control,%eax pushl %eax call leave addl $8,%esp # retpending = 0; movl $0,%eax movl %eax,retpending # control=0; movl $0,%eax movl %eax,control # } _431: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _439: .size fdecl,_439-fdecl # # void # fcheck(NMTBL *n) # fcheck # 694 # { .align 2 .globl fcheck fcheck: .type fcheck,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(mode!=GDECL||car(type)!=FUNCTION) error(DCERR); movl $1,%eax movl mode,%ecx subl %eax,%ecx jne _442 movl $-8,%ecx movl type,%eax pushl %eax call car addl $4,%esp subl %ecx,%eax je _441 _442: movl $2,%eax pushl %eax call error addl $4,%esp # if(n->sc==FUNCTION) compatible(car(n->ty),cadr(type)); _441: movl $-8,%eax movl $4,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _443 movl type,%edx pushl %edx call cadr addl $4,%esp pushl %eax movl $8,%eax movl 8(%ebp),%edx addl %eax,%edx movl (%edx),%edx pushl %edx call car addl $4,%esp pushl %eax call compatible addl $8,%esp # else { jmp _444 _443: # if(n->sc!=EMPTY) movl $-9,%eax movl $4,%ecx movl 8(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _445 # error(DCERR); movl $2,%edx pushl %edx call error addl $4,%esp # else { jmp _446 _445: # n->sc=FUNCTION; movl $-8,%eax movl $4,%edx movl 8(%ebp),%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # n->ty=list2(cadr(type),0); movl $0,%ecx pushl %ecx movl type,%ecx pushl %ecx call cadr addl $4,%esp pushl %eax call list2 addl $8,%esp movl $8,%edx movl 8(%ebp),%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # } # } _446: # } _444: movl %ecx,%eax _440: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _447: .size fcheck,_447-fcheck # # void # compatible(int t1, int t2) # compatible # 514 # 514 # { .align 2 .globl compatible compatible: .type compatible,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(integral(t1)) { movl 8(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _449 # if(t1!=t2) error(TYERR); movl 12(%ebp),%eax movl 8(%ebp),%ecx subl %eax,%ecx je _450 movl $15,%ecx pushl %ecx call error addl $4,%esp # } _450: # else if(car(t1)!=car(t2)) jmp _451 _449: movl 12(%ebp),%eax pushl %eax call car addl $4,%esp movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _452 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # else if((car(t1)==STRUCT || car(t1)==UNION) && cadr(t1)!=cadr(t2)) jmp _453 _452: movl $-6,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _455 movl $-7,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _454 _455: movl 12(%ebp),%eax pushl %eax call cadr addl $4,%esp movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp subl %ecx,%eax je _454 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # else if(car(t1)==POINTER || car(t1)==ARRAY ||car(t1)==FUNCTION) jmp _456 _454: movl $-4,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _458 movl $-5,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _458 movl $-8,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _457 _458: # compatible(cadr(t1),cadr(t2)); movl 12(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax call compatible addl $8,%esp # } _457: _456: _453: _451: _448: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _459: .size compatible,_459-compatible # # int # scalar(int t) # scalar # 819 # { .align 2 .globl scalar scalar: .type scalar,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return(integral(t)||car(t)==POINTER); movl 8(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _461 movl $-4,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _461 xorl %eax,%eax jmp _462 _461: movl $1,%eax _462: # } _460: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _463: .size scalar,_463-scalar # # int # integral(int t) # integral # 739 # { .align 2 .globl integral integral: .type integral,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return(t==INT||t==CHAR||t==UNSIGNED); movl $-1,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _465 movl $-2,%ecx movl 8(%ebp),%eax subl %ecx,%eax je _465 movl $-3,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _465 xorl %ecx,%ecx jmp _466 _465: movl $1,%ecx _466: # } movl %ecx,%eax _464: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _467: .size integral,_467-integral # # void # checkret(void) # checkret # 0 # { .align 2 .globl checkret checkret: .type checkret,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if (retpending) { cmpl $0,retpending je _469 # ret(); call ret # control=0; movl $0,%eax movl %eax,control # retpending=0; movl $0,%eax movl %eax,retpending # } # } _469: _468: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _470: .size checkret,_470-checkret # # void # statement(void) # statement # 834 # { .align 2 .globl statement statement: .type statement,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int slfree; # # if(sym==SM) { subl $4,%esp movl $64,%eax movl sym,%ecx subl %eax,%ecx jne _472 # getsym(); return; call getsym # } jmp _471 # checkret(); _472: call checkret # switch(sym) { movl sym,%eax # case IF: # doif(); cmpl $-15,%eax jne _475 _474: call doif # return; # case WHILE: jmp _471 # dowhile(); _475: cmpl $-19,%eax jne _477 _476: call dowhile # return; # case DO: jmp _471 # dodo(); _477: cmpl $-18,%eax jne _479 _478: call dodo # return; # case FOR: jmp _471 # dofor(); _479: cmpl $-17,%eax jne _481 _480: call dofor # return; # case SWITCH: jmp _471 # doswitch(); _481: cmpl $-20,%eax jne _483 _482: call doswitch # return; # case LC: jmp _471 # docomp(); _483: cmpl $61,%eax jne _485 _484: call docomp # return; # case BREAK: jmp _471 # jmp(blabel); _485: cmpl $-13,%eax jne _487 _486: movl blabel,%eax pushl %eax call jmp addl $4,%esp # getsym(); call getsym # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # return; # case CONTINUE: jmp _471 # jmp(clabel); _487: cmpl $-14,%eax jne _489 _488: movl clabel,%eax pushl %eax call jmp addl $4,%esp # getsym(); call getsym # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # return; # case CASE: jmp _471 # docase(); _489: cmpl $-21,%eax jne _491 _490: call docase # statement(); call statement # return; # case DEFAULT: jmp _471 # dodefault(); _491: cmpl $-22,%eax jne _493 _492: call dodefault # statement(); call statement # return; # case RETURN: jmp _471 # doreturn(); _493: cmpl $-12,%eax jne _495 _494: call doreturn # return; # case GOTO: jmp _471 # dogoto(); _495: cmpl $-11,%eax jne _497 _496: call dogoto # return; # default: jmp _471 # if(sym==IDENT&&skipspc()==':') { _498: movl $-26,%eax movl sym,%ecx subl %eax,%ecx jne _499 movl $58,%ecx call skipspc subl %ecx,%eax jne _499 # dolabel(); call dolabel # statement(); call statement # } else { jmp _500 _499: # slfree=lfree; movl lfree,%eax movl %eax,-16(%ebp) # gexpr(expr()); call expr pushl %eax call gexpr addl $4,%esp # lfree=slfree; movl -16(%ebp),%eax movl %eax,lfree # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # } # } _500: # } jmp _501 _497: jmp _498 _501: _473: _471: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _502: .size statement,_502-statement # # void # doif(void) # doif # 564 # { .align 2 .globl doif doif: .type doif,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int l1,l2,slfree; # getsym(); subl $12,%esp call getsym # checksym(LPAR); movl $57,%eax pushl %eax call checksym addl $4,%esp # slfree=lfree; movl lfree,%eax movl %eax,-24(%ebp) # bexpr(expr(),0,l1=fwdlabel()); call fwdlabel movl %eax,-16(%ebp) pushl %eax movl $0,%eax pushl %eax call expr pushl %eax call bexpr addl $12,%esp # lfree=slfree; movl -24(%ebp),%eax movl %eax,lfree # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # statement(); call statement # checkret(); call checkret # if(sym==ELSE) { movl $-16,%eax movl sym,%ecx subl %eax,%ecx jne _504 # if ((l2 = control)) movl control,%ecx movl %ecx,-20(%ebp) cmpl $0,%ecx je _505 # jmp(l2=fwdlabel()); call fwdlabel movl %eax,-20(%ebp) pushl %eax call jmp addl $4,%esp # fwddef(l1); _505: movl -16(%ebp),%eax pushl %eax call fwddef addl $4,%esp # getsym(); call getsym # statement(); call statement # checkret(); call checkret # if (l2) fwddef(l2); cmpl $0,-20(%ebp) je _506 movl -20(%ebp),%eax pushl %eax call fwddef addl $4,%esp # } _506: # else fwddef(l1); jmp _507 _504: movl -16(%ebp),%eax pushl %eax call fwddef addl $4,%esp # } _507: _503: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _508: .size doif,_508-doif # # void # dowhile(void) # dowhile # 584 # { .align 2 .globl dowhile dowhile: .type dowhile,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int sbreak,scontinue,slfree,e; # # sbreak=blabel; subl $16,%esp movl blabel,%eax movl %eax,-16(%ebp) # scontinue=clabel; movl clabel,%eax movl %eax,-20(%ebp) # blabel=fwdlabel(); call fwdlabel movl %eax,blabel # clabel=backdef(); call backdef movl %eax,clabel # getsym(); call getsym # checksym(LPAR); movl $57,%eax pushl %eax call checksym addl $4,%esp # slfree=lfree; movl lfree,%eax movl %eax,-24(%ebp) # e=expr(); call expr movl %eax,-28(%ebp) # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # if(sym==SM) { movl $64,%eax movl sym,%ecx subl %eax,%ecx jne _510 # bexpr(e,1,clabel); movl clabel,%ecx pushl %ecx movl $1,%ecx pushl %ecx movl -28(%ebp),%ecx pushl %ecx call bexpr addl $12,%esp # lfree=slfree; movl -24(%ebp),%eax movl %eax,lfree # getsym(); call getsym # } else { jmp _511 _510: # bexpr(e,0,blabel); movl blabel,%eax pushl %eax movl $0,%eax pushl %eax movl -28(%ebp),%eax pushl %eax call bexpr addl $12,%esp # lfree=slfree; movl -24(%ebp),%eax movl %eax,lfree # statement(); call statement # checkret(); call checkret # if(control) cmpl $0,control je _512 # jmp(clabel); movl clabel,%eax pushl %eax call jmp addl $4,%esp # } _512: # fwddef(blabel); _511: movl blabel,%eax pushl %eax call fwddef addl $4,%esp # clabel=scontinue; movl -20(%ebp),%eax movl %eax,clabel # blabel=sbreak; movl -16(%ebp),%eax movl %eax,blabel # } _509: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _513: .size dowhile,_513-dowhile # # void # dodo(void) # dodo # 549 # { .align 2 .globl dodo dodo: .type dodo,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int sbreak,scontinue,l,slfree; # # sbreak=blabel; subl $16,%esp movl blabel,%eax movl %eax,-16(%ebp) # scontinue=clabel; movl clabel,%eax movl %eax,-20(%ebp) # blabel=fwdlabel(); call fwdlabel movl %eax,blabel # clabel=fwdlabel(); call fwdlabel movl %eax,clabel # l=backdef(); call backdef movl %eax,-24(%ebp) # getsym(); call getsym # statement(); call statement # checkret(); call checkret # fwddef(clabel); movl clabel,%eax pushl %eax call fwddef addl $4,%esp # checksym(WHILE); movl $-19,%eax pushl %eax call checksym addl $4,%esp # checksym(LPAR); movl $57,%eax pushl %eax call checksym addl $4,%esp # slfree=lfree; movl lfree,%eax movl %eax,-28(%ebp) # bexpr(expr(),1,l); movl -24(%ebp),%eax pushl %eax movl $1,%eax pushl %eax call expr pushl %eax call bexpr addl $12,%esp # lfree=slfree; movl -28(%ebp),%eax movl %eax,lfree # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # fwddef(blabel); movl blabel,%eax pushl %eax call fwddef addl $4,%esp # clabel=scontinue; movl -20(%ebp),%eax movl %eax,clabel # blabel=sbreak; movl -16(%ebp),%eax movl %eax,blabel # } _514: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _515: .size dodo,_515-dodo # # void # dofor(void) # dofor # 554 # { .align 2 .globl dofor dofor: .type dofor,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int sbreak,scontinue,l,e,slfree; # # sbreak=blabel; subl $20,%esp movl blabel,%eax movl %eax,-16(%ebp) # scontinue=clabel; movl clabel,%eax movl %eax,-20(%ebp) # blabel=fwdlabel(); call fwdlabel movl %eax,blabel # getsym(); call getsym # checksym(LPAR); movl $57,%eax pushl %eax call checksym addl $4,%esp # slfree=lfree; movl lfree,%eax movl %eax,-32(%ebp) # if(sym!=SM) { movl $64,%eax movl sym,%ecx subl %eax,%ecx je _517 # gexpr(expr()); call expr pushl %eax call gexpr addl $4,%esp # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # } # else getsym(); jmp _518 _517: call getsym # lfree=slfree; _518: movl -32(%ebp),%eax movl %eax,lfree # l=backdef(); call backdef movl %eax,-24(%ebp) # if(sym!=SM) { movl $64,%eax movl sym,%ecx subl %eax,%ecx je _519 # bexpr(expr(),0,blabel); movl blabel,%ecx pushl %ecx movl $0,%ecx pushl %ecx call expr pushl %eax call bexpr addl $12,%esp # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # } # else getsym(); jmp _520 _519: call getsym # lfree=slfree; _520: movl -32(%ebp),%eax movl %eax,lfree # if(sym==RPAR) { movl $58,%eax movl sym,%ecx subl %eax,%ecx jne _521 # clabel=l; movl -24(%ebp),%ecx movl %ecx,clabel # getsym(); call getsym # statement(); call statement # checkret(); call checkret # } else { jmp _522 _521: # clabel=fwdlabel(); call fwdlabel movl %eax,clabel # e=expr(); call expr movl %eax,-28(%ebp) # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # statement(); call statement # checkret(); call checkret # fwddef(clabel); movl clabel,%eax pushl %eax call fwddef addl $4,%esp # gexpr(e); movl -28(%ebp),%eax pushl %eax call gexpr addl $4,%esp # lfree=slfree; movl -32(%ebp),%eax movl %eax,lfree # } # jmp(l); _522: movl -24(%ebp),%eax pushl %eax call jmp addl $4,%esp # fwddef(blabel); movl blabel,%eax pushl %eax call fwddef addl $4,%esp # clabel=scontinue; movl -20(%ebp),%eax movl %eax,clabel # blabel=sbreak; movl -16(%ebp),%eax movl %eax,blabel # } _516: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _523: .size dofor,_523-dofor # # void # doswitch(void) # doswitch # 574 # { .align 2 .globl doswitch doswitch: .type doswitch,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int sbreak,scase,sdefault,slfree,svalue; # # sbreak=blabel; /* save parents break label */ subl $20,%esp movl blabel,%eax movl %eax,-16(%ebp) # blabel=fwdlabel(); call fwdlabel movl %eax,blabel # sdefault=dlabel; /* save parents default label */ movl dlabel,%eax movl %eax,-24(%ebp) # dlabel=0; movl $0,%eax movl %eax,dlabel # scase=cslabel; /* save parents next case label */ movl cslabel,%eax movl %eax,-20(%ebp) # getsym(); call getsym # checksym(LPAR); movl $57,%eax pushl %eax call checksym addl $4,%esp # slfree=lfree; movl lfree,%eax movl %eax,-28(%ebp) # svalue=csvalue1; /* save parents switch value */ movl csvalue1,%eax movl %eax,-32(%ebp) # gexpr(expr()); call expr pushl %eax call gexpr addl $4,%esp # csvalue1=csvalue ; movl csvalue,%eax movl %eax,csvalue1 # lfree=slfree; movl -28(%ebp),%eax movl %eax,lfree # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # cslabel = control = 0; movl $0,%eax movl %eax,control movl %eax,cslabel # /* should be case statement but... */ # statement(); call statement # checkret(); call checkret # if(dlabel) def_label(cslabel,dlabel); cmpl $0,dlabel je _525 movl dlabel,%eax pushl %eax movl cslabel,%eax pushl %eax call def_label addl $8,%esp # else fwddef(cslabel); jmp _526 _525: movl cslabel,%eax pushl %eax call fwddef addl $4,%esp # csvalue1=svalue; _526: movl -32(%ebp),%eax movl %eax,csvalue1 # cslabel=scase; movl -20(%ebp),%eax movl %eax,cslabel # dlabel=sdefault; movl -24(%ebp),%eax movl %eax,dlabel # fwddef(blabel); movl blabel,%eax pushl %eax call fwddef addl $4,%esp # blabel=sbreak; movl -16(%ebp),%eax movl %eax,blabel # } _524: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _527: .size doswitch,_527-doswitch # # void # docomp(void) # docomp # 539 # { .align 2 .globl docomp docomp: .type docomp,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # getsym(); call getsym # while(sym!=RC) { statement(); checkret();} _530: movl $62,%eax movl sym,%ecx subl %eax,%ecx je _529 call statement call checkret # getsym(); jmp _530 _529: call getsym # } _528: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _531: .size docomp,_531-docomp # # void # docase(void) # docase # 534 # { .align 2 .globl docase docase: .type docase,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int c,l,slfree; # # c=0; subl $12,%esp movl $0,%eax movl %eax,-16(%ebp) # slfree=lfree; movl lfree,%eax movl %eax,-24(%ebp) # while(sym==CASE) { _534: movl $-21,%eax movl sym,%ecx subl %eax,%ecx jne _533 # getsym(); call getsym # c=list2(cexpr(expr()),c); movl -16(%ebp),%eax pushl %eax call expr pushl %eax call cexpr addl $4,%esp pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # checksym(COLON); movl $63,%eax pushl %eax call checksym addl $4,%esp # } # l=fwdlabel(); jmp _534 _533: call fwdlabel movl %eax,-20(%ebp) # if (control) { cmpl $0,control je _535 # control=0; movl $0,%eax movl %eax,control # jmp(l); movl -20(%ebp),%eax pushl %eax call jmp addl $4,%esp # } # if (cslabel) fwddef(cslabel); _535: cmpl $0,cslabel je _536 movl cslabel,%eax pushl %eax call fwddef addl $4,%esp # while(cadr(c)) { _536: _538: movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp cmpl $0,%eax je _537 # cmpdimm(car(c),csvalue1); movl csvalue1,%eax pushl %eax movl -16(%ebp),%eax pushl %eax call car addl $4,%esp pushl %eax call cmpdimm addl $8,%esp # jcond(l,0); movl $0,%eax pushl %eax movl -20(%ebp),%eax pushl %eax call jcond addl $8,%esp # c=cadr(c); movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-16(%ebp) # } # lfree=slfree; jmp _538 _537: movl -24(%ebp),%eax movl %eax,lfree # cmpdimm(car(c),csvalue1); movl csvalue1,%eax pushl %eax movl -16(%ebp),%eax pushl %eax call car addl $4,%esp pushl %eax call cmpdimm addl $8,%esp # jcond(cslabel=fwdlabel(),1); movl $1,%eax pushl %eax call fwdlabel movl %eax,cslabel pushl %eax call jcond addl $8,%esp # fwddef(l); movl -20(%ebp),%eax pushl %eax call fwddef addl $4,%esp # } _532: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _539: .size docase,_539-docase # # void # dodefault(void) # dodefault # 544 # { .align 2 .globl dodefault dodefault: .type dodefault,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # getsym(); call getsym # checksym(COLON); movl $63,%eax pushl %eax call checksym addl $4,%esp # if (dlabel) error(STERR); cmpl $0,dlabel je _541 movl $3,%eax pushl %eax call error addl $4,%esp # if (!cslabel) jmp(cslabel = fwdlabel()); _541: cmpl $0,cslabel jne _542 call fwdlabel movl %eax,cslabel pushl %eax call jmp addl $4,%esp # dlabel = backdef(); _542: call backdef movl %eax,dlabel # } _540: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _543: .size dodefault,_543-dodefault # # void # doreturn(void) # doreturn # 579 # { .align 2 .globl doreturn doreturn: .type doreturn,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int slfree; # # if(getsym()==SM) { subl $4,%esp movl $64,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _545 # getsym(); call getsym # retpending = 1; movl $1,%eax movl %eax,retpending # return; # } jmp _544 # slfree=lfree; _545: movl lfree,%eax movl %eax,-16(%ebp) # gexpr(expr()); call expr pushl %eax call gexpr addl $4,%esp # lfree=slfree; movl -16(%ebp),%eax movl %eax,lfree # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # retpending = 1; movl $1,%eax movl %eax,retpending # } _544: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _546: .size doreturn,_546-doreturn # # # void # dogoto(void) # dogoto # 559 # { .align 2 .globl dogoto dogoto: .type dogoto,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *nptr0; # int t,e1,e2,env; # # getsym(); subl $20,%esp call getsym # e1 = expr(); call expr movl %eax,-24(%ebp) # t=car(e1); movl -24(%ebp),%eax pushl %eax call car addl $4,%esp movl %eax,-20(%ebp) # if (t==FNAME) { movl $8,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _548 # nptr0 = (NMTBL *)cadr(e1); movl -24(%ebp),%ecx pushl %ecx call cadr addl $4,%esp movl %eax,-16(%ebp) # t = nptr0->sc; movl $4,%eax movl -16(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx movl %ecx,-20(%ebp) # if (t==EMPTY) { movl $-9,%ecx movl -20(%ebp),%eax subl %ecx,%eax jne _549 # nptr0->sc = FLABEL; movl $-30,%eax movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # jmp(nptr0->dsp = fwdlabel()); call fwdlabel movl $12,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx pushl %edx call jmp addl $4,%esp # } else if (t==FLABEL||t==BLABEL) { jmp _550 _549: movl $-30,%eax movl -20(%ebp),%ecx subl %eax,%ecx je _552 movl $-29,%ecx movl -20(%ebp),%eax subl %ecx,%eax jne _551 _552: # jmp(nptr0->dsp); movl $12,%eax movl -16(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call jmp addl $4,%esp # } # control=0; _551: _550: movl $0,%eax movl %eax,control # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # return; # } jmp _547 # if (t==COMMA) { _548: movl $56,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _553 # env = caddr(e1); movl -24(%ebp),%ecx pushl %ecx call caddr addl $4,%esp movl %eax,-32(%ebp) # e1 = cadr(e1); movl -24(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-24(%ebp) # t = car(e1); movl -24(%ebp),%eax pushl %eax call car addl $4,%esp movl %eax,-20(%ebp) # } else { jmp _554 _553: # env = 0; movl $0,%eax movl %eax,-32(%ebp) # } # if (t==FUNCTION) { _554: movl $-8,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _555 # e2 = cadr(e1); movl -24(%ebp),%ecx pushl %ecx call cadr addl $4,%esp movl %eax,-28(%ebp) # if (car(e2) == FNAME) { movl $8,%eax movl -28(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _556 # nptr0=(NMTBL *)cadr(e2); movl -28(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-16(%ebp) # nptr0->sc = CODE; movl $-39,%eax movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # } # gexpr(list3(CODE,e1,env)); _556: movl -32(%ebp),%edx pushl %edx movl -24(%ebp),%edx pushl %edx movl $-39,%edx pushl %edx call list3 addl $12,%esp pushl %eax call gexpr addl $4,%esp # control=0; movl $0,%eax movl %eax,control # checksym(SM); movl $64,%eax pushl %eax call checksym addl $4,%esp # return; # } jmp _547 # error(STERR); _555: movl $3,%eax pushl %eax call error addl $4,%esp # return; # } _547: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _557: .size dogoto,_557-dogoto # # void # dolabel(void) # dolabel # 569 # { .align 2 .globl dolabel dolabel: .type dolabel,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(nptr->sc == FLABEL) movl $-30,%eax movl $4,%ecx movl nptr,%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _559 # fwddef(nptr->dsp); movl $12,%edx movl nptr,%eax addl %edx,%eax movl (%eax),%eax pushl %eax call fwddef addl $4,%esp # else if(nptr->sc != EMPTY) jmp _560 _559: movl $-9,%eax movl $4,%ecx movl nptr,%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _561 # error(TYERR); movl $15,%edx pushl %edx call error addl $4,%esp # nptr->sc = BLABEL; _561: _560: movl $-29,%eax movl $4,%edx movl nptr,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # nptr->dsp = backdef(); call backdef movl $12,%edx movl nptr,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # getsym(); call getsym # checksym(COLON); movl $63,%eax pushl %eax call checksym addl $4,%esp # } _558: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _562: .size dolabel,_562-dolabel # # int # expr(void) # expr # 604 # { .align 2 .globl expr expr: .type expr,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return(rvalue(expr0())); call expr0 pushl %eax call rvalue addl $4,%esp # } _563: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _564: .size expr,_564-expr # # int # expr0(void) # expr0 # 609 # { .align 2 .globl expr0 expr0: .type expr0,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # e=expr1(); subl $4,%esp call expr1 movl %eax,-16(%ebp) # while(sym==COMMA) { _567: movl $56,%eax movl sym,%ecx subl %eax,%ecx jne _566 # getsym();e=list3(COMMA,e,rvalue(expr1())); call getsym call expr1 pushl %eax call rvalue addl $4,%esp pushl %eax movl -16(%ebp),%eax pushl %eax movl $56,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # } # return e; jmp _567 _566: movl -16(%ebp),%eax # } _565: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _568: .size expr0,_568-expr0 # # int # expr1(void) # expr1 # 614 # { .align 2 .globl expr1 expr1: .type expr1,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t,op; # e1=expr2(); subl $16,%esp call expr2 movl %eax,-16(%ebp) # switch (sym) { movl sym,%eax # case ASS: # lcheck(e1); cmpl $52,%eax jne _572 _571: movl -16(%ebp),%eax pushl %eax call lcheck addl $4,%esp # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr1()); call expr1 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # if(t==VOID) movl $-37,%eax movl -24(%ebp),%ecx subl %eax,%ecx jne _573 # error(TYERR); movl $15,%ecx pushl %ecx call error addl $4,%esp # if(t==CHAR) { _573: movl $-2,%eax movl -24(%ebp),%ecx subl %eax,%ecx jne _574 # type= INT;return(list3(CASS,e1,e2)); movl $-1,%ecx movl %ecx,type movl -20(%ebp),%ecx pushl %ecx movl -16(%ebp),%ecx pushl %ecx movl $53,%ecx pushl %ecx call list3 addl $12,%esp # } else if(t==STRUCT||t==UNION) { jmp _569 _574: movl $-6,%eax movl -24(%ebp),%ecx subl %eax,%ecx je _576 movl $-7,%ecx movl -24(%ebp),%eax subl %ecx,%eax jne _575 _576: # type= t;return(list3(SASS,e1,e2)); movl -24(%ebp),%eax movl %eax,type movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $68,%eax pushl %eax call list3 addl $12,%esp # } jmp _569 # type=t; _575: movl -24(%ebp),%eax movl %eax,type # return(list3(ASS,e1,e2)); movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $52,%eax pushl %eax call list3 addl $12,%esp # case ADD+AS: case SUB+AS: case MUL+AS: case DIV+AS: case MOD+AS: jmp _569 # case RSHIFT+AS: case LSHIFT+AS: case BAND+AS: case EOR+AS: case BOR+AS: # op = sym-AS; _572: cmpl $148,%eax je _577 cmpl $147,%eax je _577 cmpl $146,%eax je _577 cmpl $134,%eax je _577 cmpl $132,%eax je _577 cmpl $128,%eax je _577 cmpl $126,%eax je _577 cmpl $124,%eax je _577 cmpl $131,%eax je _577 cmpl $130,%eax jne _578 _577: movl $100,%eax movl sym,%ecx subl %eax,%ecx movl %ecx,-28(%ebp) # lcheck(e1); movl -16(%ebp),%ecx pushl %ecx call lcheck addl $4,%esp # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr1()); call expr1 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # if(!integral(type)) error(TYERR); movl type,%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _579 movl $15,%eax pushl %eax call error addl $4,%esp # if((t==UNSIGNED||type==UNSIGNED)&& _579: # (op==MUL||op==DIV||op==MOD||op==RSHIFT||op==LSHIFT)) movl $-3,%eax movl -24(%ebp),%ecx subl %eax,%ecx je _581 movl $-3,%ecx movl type,%eax subl %ecx,%eax jne _580 _581: movl $24,%eax movl -28(%ebp),%ecx subl %eax,%ecx je _582 movl $26,%ecx movl -28(%ebp),%eax subl %ecx,%eax je _582 movl $28,%eax movl -28(%ebp),%ecx subl %eax,%ecx je _582 movl $32,%ecx movl -28(%ebp),%eax subl %ecx,%eax je _582 movl $34,%eax movl -28(%ebp),%ecx subl %eax,%ecx jne _580 _582: # op=op+US; movl $1,%ecx movl -28(%ebp),%eax addl %ecx,%eax movl %eax,-28(%ebp) # if(t==CHAR) { _580: movl $-2,%eax movl -24(%ebp),%ecx subl %eax,%ecx jne _583 # type= INT; movl $-1,%ecx movl %ecx,type # return(list4(CASSOP,e1,e2,op)); movl -28(%ebp),%ecx pushl %ecx movl -20(%ebp),%ecx pushl %ecx movl -16(%ebp),%ecx pushl %ecx movl $55,%ecx pushl %ecx call list4 addl $16,%esp # } jmp _569 # type=t; _583: movl -24(%ebp),%eax movl %eax,type # if(integral(t)) return(list4(ASSOP,e1,e2,op)); movl -24(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _584 movl -28(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $54,%eax pushl %eax call list4 addl $16,%esp # if((op!=ADD&&op!=SUB)||car(t)!=POINTER) error(TYERR); jmp _569 _584: movl $30,%eax movl -28(%ebp),%ecx subl %eax,%ecx je _587 movl $31,%ecx movl -28(%ebp),%eax subl %ecx,%eax jne _586 _587: movl $-4,%eax movl -24(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _585 _586: movl $15,%eax pushl %eax call error addl $4,%esp # e2=binop(MUL,e2,list2(CONST,size(cadr(t))),INT,UNSIGNED); _585: movl $-3,%eax pushl %eax movl $-1,%eax pushl %eax movl -24(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl -20(%ebp),%eax pushl %eax movl $24,%eax pushl %eax call binop addl $20,%esp movl %eax,-20(%ebp) # type=t; movl -24(%ebp),%eax movl %eax,type # return list4(ASSOP,e1,e2,op); movl -28(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $54,%eax pushl %eax call list4 addl $16,%esp # default: jmp _569 # return(e1); _588: movl -16(%ebp),%eax # } jmp _569 # } _578: jmp _588 _570: _569: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _589: .size expr1,_589-expr1 # # int # expr2(void) # expr2 # 619 # { .align 2 .globl expr2 expr2: .type expr2,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,e3,t; # # e1=expr3(); subl $16,%esp call expr3 movl %eax,-16(%ebp) # if(sym==COND) { movl $51,%eax movl sym,%ecx subl %eax,%ecx jne _591 # e1=rvalue(e1); movl -16(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,-16(%ebp) # getsym(); call getsym # e2=rvalue(expr2()); call expr2 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # t=type; movl type,%eax movl %eax,-28(%ebp) # checksym(COLON); movl $63,%eax pushl %eax call checksym addl $4,%esp # e3=rvalue(expr2()); call expr2 pushl %eax call rvalue addl $4,%esp movl %eax,-24(%ebp) # if(car(e1)==CONST) { movl $7,%eax movl -16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _592 # if(cadr(e1)) { movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp cmpl $0,%eax je _593 # type=t;return e2; movl -28(%ebp),%eax movl %eax,type movl -20(%ebp),%eax # } else jmp _590 _593: # return e3; movl -24(%ebp),%eax # } jmp _590 # if(type==INT||(t!=INT&&type==UNSIGNED)) _592: movl $-1,%eax movl type,%ecx subl %eax,%ecx je _595 movl $-1,%ecx movl -28(%ebp),%eax subl %ecx,%eax je _594 movl $-3,%eax movl type,%ecx subl %eax,%ecx jne _594 _595: # type=t; movl -28(%ebp),%ecx movl %ecx,type # return(list4(COND,e1,e2,e3)); _594: movl -24(%ebp),%ecx pushl %ecx movl -20(%ebp),%ecx pushl %ecx movl -16(%ebp),%ecx pushl %ecx movl $51,%ecx pushl %ecx call list4 addl $16,%esp # } jmp _590 # return(e1); _591: movl -16(%ebp),%eax # } _590: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _596: .size expr2,_596-expr2 # # int # expr3(void) # expr3 # 624 # { .align 2 .globl expr3 expr3: .type expr3,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # e=expr4(); subl $4,%esp call expr4 movl %eax,-16(%ebp) # while(sym==LOR) { _599: movl $50,%eax movl sym,%ecx subl %eax,%ecx jne _598 # e=rvalue(e); movl -16(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,-16(%ebp) # getsym(); call getsym # e=list3(LOR,e,rvalue(expr4())); call expr4 pushl %eax call rvalue addl $4,%esp pushl %eax movl -16(%ebp),%eax pushl %eax movl $50,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # type= INT; movl $-1,%eax movl %eax,type # } # return(e); jmp _599 _598: movl -16(%ebp),%eax # } _597: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _600: .size expr3,_600-expr3 # # int # expr4(void) # expr4 # 629 # { .align 2 .globl expr4 expr4: .type expr4,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # e=expr5(); subl $4,%esp call expr5 movl %eax,-16(%ebp) # while(sym==LAND) { _603: movl $49,%eax movl sym,%ecx subl %eax,%ecx jne _602 # e=rvalue(e); movl -16(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,-16(%ebp) # getsym(); call getsym # e=list3(LAND,e,rvalue(expr5())); call expr5 pushl %eax call rvalue addl $4,%esp pushl %eax movl -16(%ebp),%eax pushl %eax movl $49,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # type= INT; movl $-1,%eax movl %eax,type # } # return(e); jmp _603 _602: movl -16(%ebp),%eax # } _601: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _604: .size expr4,_604-expr4 # # int # expr5(void) # expr5 # 634 # { .align 2 .globl expr5 expr5: .type expr5,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t; # # e1=expr6(); subl $12,%esp call expr6 movl %eax,-16(%ebp) # while(sym==BOR) { _607: movl $48,%eax movl sym,%ecx subl %eax,%ecx jne _606 # e1=rvalue(e1); movl -16(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,-16(%ebp) # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr6()); call expr6 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # e1=binop(BOR,e1,e2,t,type); movl type,%eax pushl %eax movl -24(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $48,%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # } # return(e1); jmp _607 _606: movl -16(%ebp),%eax # } _605: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _608: .size expr5,_608-expr5 # # int # expr6(void) # expr6 # 639 # { .align 2 .globl expr6 expr6: .type expr6,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t; # # e1=expr7(); subl $12,%esp call expr7 movl %eax,-16(%ebp) # while(sym==EOR) { _611: movl $47,%eax movl sym,%ecx subl %eax,%ecx jne _610 # e1=rvalue(e1); movl -16(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,-16(%ebp) # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr7()); call expr7 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # e1=binop(EOR,e1,e2,t,type); movl type,%eax pushl %eax movl -24(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $47,%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # } # return(e1); jmp _611 _610: movl -16(%ebp),%eax # } _609: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _612: .size expr6,_612-expr6 # # int # expr7(void) # expr7 # 644 # { .align 2 .globl expr7 expr7: .type expr7,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t; # # e1=expr8(); subl $12,%esp call expr8 movl %eax,-16(%ebp) # while(sym==BAND) { _615: movl $46,%eax movl sym,%ecx subl %eax,%ecx jne _614 # e1=rvalue(e1); movl -16(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,-16(%ebp) # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr8()); call expr8 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # e1=binop(BAND,e1,e2,t,type); movl type,%eax pushl %eax movl -24(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $46,%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # } # return(e1); jmp _615 _614: movl -16(%ebp),%eax # } _613: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _616: .size expr7,_616-expr7 # # int # expr8(void) # expr8 # 649 # { .align 2 .globl expr8 expr8: .type expr8,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e,op; # # e=expr9(); subl $8,%esp call expr9 movl %eax,-16(%ebp) # while((op=sym)==EQ||op==NEQ) { _619: movl $44,%eax movl sym,%ecx movl %ecx,-20(%ebp) subl %eax,%ecx je _620 movl $45,%ecx movl -20(%ebp),%eax subl %ecx,%eax jne _618 _620: # e=rvalue(e); movl -16(%ebp),%eax pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # getsym(); call getsym # e=list3(op,e,rvalue(expr9())); call expr9 pushl %eax call rvalue addl $4,%esp pushl %eax movl -16(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # type= INT; movl $-1,%eax movl %eax,type # } # return e; jmp _619 _618: movl -16(%ebp),%eax # } _617: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _621: .size expr8,_621-expr8 # # int # expr9(void) # expr9 # 654 # { .align 2 .globl expr9 expr9: .type expr9,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t,op; # # e1=expr10(); subl $16,%esp call expr10 movl %eax,-16(%ebp) # while((op=sym)==GT||op==GE||op==LT||op==LE) { _624: movl $36,%eax movl sym,%ecx movl %ecx,-28(%ebp) subl %eax,%ecx je _625 movl $38,%ecx movl -28(%ebp),%eax subl %ecx,%eax je _625 movl $40,%eax movl -28(%ebp),%ecx subl %eax,%ecx je _625 movl $42,%ecx movl -28(%ebp),%eax subl %ecx,%eax jne _623 _625: # e1=rvalue(e1); movl -16(%ebp),%eax pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr10()); call expr10 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # if(t==INT&&type==INT) movl $-1,%eax movl -24(%ebp),%ecx subl %eax,%ecx jne _626 movl $-1,%ecx movl type,%eax subl %ecx,%eax jne _626 # e1=list3(op,e1,e2); movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl -28(%ebp),%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # else jmp _627 _626: # e1=list3(op+US,e1,e2); movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $1,%eax movl -28(%ebp),%ecx addl %eax,%ecx pushl %ecx call list3 addl $12,%esp movl %eax,-16(%ebp) # type= INT; _627: movl $-1,%eax movl %eax,type # } # return e1; jmp _624 _623: movl -16(%ebp),%eax # } _622: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _628: .size expr9,_628-expr9 # # int # expr10(void) # expr10 # 659 # { .align 2 .globl expr10 expr10: .type expr10,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t,op; # # e1=expr11(); subl $16,%esp call expr11 movl %eax,-16(%ebp) # while((op=sym)==RSHIFT||op==LSHIFT) { _631: movl $32,%eax movl sym,%ecx movl %ecx,-28(%ebp) subl %eax,%ecx je _632 movl $34,%ecx movl -28(%ebp),%eax subl %ecx,%eax jne _630 _632: # e1=rvalue(e1); movl -16(%ebp),%eax pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr11()); call expr11 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # e1=binop(op,e1,e2,t,type); movl type,%eax pushl %eax movl -24(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl -28(%ebp),%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # } # return e1; jmp _631 _630: movl -16(%ebp),%eax # } _629: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _633: .size expr10,_633-expr10 # # int # expr11(void) # expr11 # 664 # { .align 2 .globl expr11 expr11: .type expr11,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t,op; # # e1=expr12(); subl $16,%esp call expr12 movl %eax,-16(%ebp) # while((op=sym)==ADD||op==SUB) { _636: movl $30,%eax movl sym,%ecx movl %ecx,-28(%ebp) subl %eax,%ecx je _637 movl $31,%ecx movl -28(%ebp),%eax subl %ecx,%eax jne _635 _637: # e1=rvalue(e1); movl -16(%ebp),%eax pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr12()); call expr12 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # e1=binop(op,e1,e2,t,type); movl type,%eax pushl %eax movl -24(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl -28(%ebp),%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # } # return e1; jmp _636 _635: movl -16(%ebp),%eax # } _634: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _638: .size expr11,_638-expr11 # # int # expr12(void) # expr12 # 669 # { .align 2 .globl expr12 expr12: .type expr12,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,e2,t,op; # # e1=expr13(); subl $16,%esp call expr13 movl %eax,-16(%ebp) # while((op=sym)==MUL||op==DIV||op==MOD) { _641: movl $24,%eax movl sym,%ecx movl %ecx,-28(%ebp) subl %eax,%ecx je _642 movl $26,%ecx movl -28(%ebp),%eax subl %ecx,%eax je _642 movl $28,%eax movl -28(%ebp),%ecx subl %eax,%ecx jne _640 _642: # e1=rvalue(e1); movl -16(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,-16(%ebp) # t=type; movl type,%eax movl %eax,-24(%ebp) # getsym(); call getsym # e2=rvalue(expr13()); call expr13 pushl %eax call rvalue addl $4,%esp movl %eax,-20(%ebp) # e1=binop(op,e1,e2,t,type); movl type,%eax pushl %eax movl -24(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl -28(%ebp),%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # } # return e1; jmp _641 _640: movl -16(%ebp),%eax # } _639: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _643: .size expr12,_643-expr12 # # int # expr13(void) # expr13 # 674 # { .align 2 .globl expr13 expr13: .type expr13,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e,op; # # switch (op = sym) { subl $8,%esp movl sym,%eax movl %eax,-20(%ebp) # case INC: case DEC: # getsym(); cmpl $21,%eax je _646 cmpl $16,%eax jne _647 _646: call getsym # lcheck(e=expr13()); call expr13 movl %eax,-16(%ebp) pushl %eax call lcheck addl $4,%esp # if(type==CHAR) { movl $-2,%eax movl type,%ecx subl %eax,%ecx jne _648 # type= INT; movl $-1,%ecx movl %ecx,type # return(list2(op==INC?CPREINC:CPREDEC,e)); movl -16(%ebp),%ecx pushl %ecx movl $16,%ecx movl -20(%ebp),%eax subl %ecx,%eax jne _649 movl $20,%eax jmp _650 _649: movl $23,%eax _650: pushl %eax call list2 addl $8,%esp # } jmp _644 # if(integral(type)) _648: movl type,%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _651 # return(list3(PREINC,e,op==INC?1:-1)); movl $16,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _652 movl $1,%ecx jmp _653 _652: movl $-1,%ecx _653: pushl %ecx movl -16(%ebp),%ecx pushl %ecx movl $18,%ecx pushl %ecx call list3 addl $12,%esp # if(car(type)!=POINTER) jmp _644 _651: movl $-4,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _654 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # return(list3(PREINC,e, _654: # op==INC?size(cadr(type)):-size(cadr(type)) )); movl $16,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _655 movl type,%ecx pushl %ecx call cadr addl $4,%esp pushl %eax call size addl $4,%esp jmp _656 _655: movl type,%eax pushl %eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp negl %eax _656: pushl %eax movl -16(%ebp),%eax pushl %eax movl $18,%eax pushl %eax call list3 addl $12,%esp # case MUL: jmp _644 # getsym(); _647: cmpl $24,%eax jne _658 _657: call getsym # e=rvalue(expr13()); call expr13 pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # return(indop(e)); movl -16(%ebp),%eax pushl %eax call indop addl $4,%esp # case BAND: jmp _644 # getsym(); _658: cmpl $46,%eax jne _660 _659: call getsym # switch(car(e=expr13())) { call expr13 movl %eax,-16(%ebp) pushl %eax call car addl $4,%esp # case INDIRECT: # e=cadr(e); cmpl $9,%eax jne _663 _662: movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-16(%ebp) # break; jmp _661 # case GVAR: # case LVAR: # e=list2(ADDRESS,e); _663: cmpl $4,%eax je _664 cmpl $1,%eax jne _665 _664: movl -16(%ebp),%eax pushl %eax movl $12,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # break; jmp _661 # case FNAME: # return e; _665: cmpl $8,%eax jne _667 _666: movl -16(%ebp),%eax # default:error(LVERR); jmp _644 _668: movl $16,%eax pushl %eax call error addl $4,%esp # } # type=list2(POINTER,type); jmp _669 _667: jmp _668 _669: _661: movl type,%eax pushl %eax movl $-4,%eax pushl %eax call list2 addl $8,%esp movl %eax,type # return e; movl -16(%ebp),%eax # case SUB: jmp _644 # getsym(); _660: cmpl $31,%eax jne _671 _670: call getsym # e=rvalue(expr13()); call expr13 pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # if(!integral(type)) movl type,%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _672 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # return(car(e)==CONST?list2(CONST,-cadr(e)):list2(MINUS,e)); _672: movl $7,%eax movl -16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _673 movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp negl %eax pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp jmp _674 _673: movl -16(%ebp),%eax pushl %eax movl $13,%eax pushl %eax call list2 addl $8,%esp _674: # case BNOT: jmp _644 # getsym(); _671: cmpl $15,%eax jne _676 _675: call getsym # e=rvalue(expr13()); call expr13 pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # if(!integral(type)) movl type,%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _677 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # return(car(e)==CONST?list2(CONST,~cadr(e)):list2(BNOT,e)); _677: movl $7,%eax movl -16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _678 movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp notl %eax pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp jmp _679 _678: movl -16(%ebp),%eax pushl %eax movl $15,%eax pushl %eax call list2 addl $8,%esp _679: # case LNOT: jmp _644 # getsym(); _676: cmpl $14,%eax jne _681 _680: call getsym # return(list2(LNOT,rvalue(expr13()))); call expr13 pushl %eax call rvalue addl $4,%esp pushl %eax movl $14,%eax pushl %eax call list2 addl $8,%esp # case SIZEOF: jmp _644 # if(getsym()==LPAR) { _681: cmpl $-32,%eax jne _683 _682: movl $57,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _684 # if(typeid(getsym())) { call getsym pushl %eax call typeid addl $4,%esp cmpl $0,%eax je _685 # e=list2(CONST,size(typename())); call typename pushl %eax call size addl $4,%esp pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # type=INT; movl $-1,%eax movl %eax,type # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # return e; movl -16(%ebp),%eax # } else { jmp _644 _685: # e=expr0(); call expr0 movl %eax,-16(%ebp) # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # expr16(e); movl -16(%ebp),%eax pushl %eax call expr16 addl $4,%esp # if(sym==INC||sym==DEC) { movl $16,%eax movl sym,%ecx subl %eax,%ecx je _687 movl $21,%ecx movl sym,%eax subl %ecx,%eax jne _686 _687: # getsym(); call getsym # if(type==CHAR) type=INT; movl $-2,%eax movl type,%ecx subl %eax,%ecx jne _688 movl $-1,%ecx movl %ecx,type # else if(!scalar(type)) jmp _689 _688: movl type,%ecx pushl %ecx call scalar addl $4,%esp cmpl $0,%eax jne _690 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # } _690: _689: # } _686: # } else jmp _691 _684: # expr13(); call expr13 # e=list2(CONST,size(type)); _691: movl type,%eax pushl %eax call size addl $4,%esp pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # type=INT; movl $-1,%eax movl %eax,type # return e; movl -16(%ebp),%eax # } jmp _644 # e=expr14(); _683: _645: call expr14 movl %eax,-16(%ebp) # if((op=sym)==INC||op==DEC) { movl $16,%eax movl sym,%ecx movl %ecx,-20(%ebp) subl %eax,%ecx je _693 movl $21,%ecx movl -20(%ebp),%eax subl %ecx,%eax jne _692 _693: # lcheck(e); movl -16(%ebp),%eax pushl %eax call lcheck addl $4,%esp # getsym(); call getsym # if(type==CHAR) { movl $-2,%eax movl type,%ecx subl %eax,%ecx jne _694 # type= INT; movl $-1,%ecx movl %ecx,type # return(list2(op==INC?CPOSTINC:CPOSTDEC,e)); movl -16(%ebp),%ecx pushl %ecx movl $16,%ecx movl -20(%ebp),%eax subl %ecx,%eax jne _695 movl $19,%eax jmp _696 _695: movl $22,%eax _696: pushl %eax call list2 addl $8,%esp # } jmp _644 # if(integral(type)) _694: movl type,%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _697 # return(list3(POSTINC,e,op==INC?1:-1)); movl $16,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _698 movl $1,%ecx jmp _699 _698: movl $-1,%ecx _699: pushl %ecx movl -16(%ebp),%ecx pushl %ecx movl $17,%ecx pushl %ecx call list3 addl $12,%esp # if(car(type)!=POINTER) jmp _644 _697: movl $-4,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _700 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # return (list3(POSTINC,e, _700: # op == INC ? size(cadr(type)): -size(cadr(type)) )); movl $16,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _701 movl type,%ecx pushl %ecx call cadr addl $4,%esp pushl %eax call size addl $4,%esp jmp _702 _701: movl type,%eax pushl %eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp negl %eax _702: pushl %eax movl -16(%ebp),%eax pushl %eax movl $17,%eax pushl %eax call list3 addl $12,%esp # } jmp _644 # return e; _692: movl -16(%ebp),%eax # } _644: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _703: .size expr13,_703-expr13 # # int # expr14(void) # expr14 # 679 # { .align 2 .globl expr14 expr14: .type expr14,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e1,t; # # switch(sym) { subl $8,%esp movl sym,%eax # case IDENT: # switch(nptr->sc) { cmpl $-26,%eax jne _707 _706: movl $4,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx # case GVAR: # e1=list3(GVAR,nptr->dsp,(int)nptr->nm); cmpl $1,%ecx jne _710 _709: movl nptr,%ecx movl (%ecx),%ecx pushl %ecx movl $12,%ecx movl nptr,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax movl $1,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # type=nptr->ty; movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx movl %ecx,type # getsym(); call getsym # break; jmp _708 # case LVAR: # e1=list2(LVAR,nptr->dsp); _710: cmpl $4,%ecx jne _712 _711: movl $12,%ecx movl nptr,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax movl $4,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # type=nptr->ty; movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx movl %ecx,type # getsym(); call getsym # break; jmp _708 # case REGISTER: # e1=list2(REGISTER,nptr->dsp); _712: cmpl $-38,%ecx jne _714 _713: movl $12,%ecx movl nptr,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax movl $-38,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # type=nptr->ty; movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx movl %ecx,type # getsym(); call getsym # break; jmp _708 # case FLABEL: case BLABEL: # case FUNCTION: case CODE: # e1=list2(FNAME,(int)nptr); _714: cmpl $-39,%ecx je _715 cmpl $-8,%ecx je _715 cmpl $-29,%ecx je _715 cmpl $-30,%ecx jne _716 _715: movl nptr,%ecx pushl %ecx movl $8,%ecx pushl %ecx call list2 addl $8,%esp movl %eax,-16(%ebp) # type=list3(nptr->sc,car(nptr->ty),cadr(nptr->ty)); movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call cadr addl $4,%esp pushl %eax movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call car addl $4,%esp pushl %eax movl $4,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call list3 addl $12,%esp movl %eax,type # getsym(); call getsym # break; jmp _708 # case EMPTY: # if(getsym()==LPAR) { _716: cmpl $-9,%ecx jne _718 _717: movl $57,%ecx call getsym subl %ecx,%eax jne _719 # nptr->sc = FUNCTION; movl $-8,%eax movl $4,%ecx movl nptr,%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # nptr->ty= list2(INT,0); movl $0,%edx pushl %edx movl $-1,%edx pushl %edx call list2 addl $8,%esp movl $8,%ecx movl nptr,%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # type= list3(FUNCTION,INT,0); movl $0,%edx pushl %edx movl $-1,%edx pushl %edx movl $-8,%edx pushl %edx call list3 addl $12,%esp movl %eax,type # e1=expr15(list2(FNAME,(int)nptr)); movl nptr,%eax pushl %eax movl $8,%eax pushl %eax call list2 addl $8,%esp pushl %eax call expr15 addl $4,%esp movl %eax,-16(%ebp) # break; jmp _708 # } else { _719: # e1=list2(FNAME,(int)nptr); movl nptr,%eax pushl %eax movl $8,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # type=list3(nptr->sc,nptr->ty,0); movl $0,%eax pushl %eax movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx movl $4,%ecx movl nptr,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax call list3 addl $12,%esp movl %eax,type # break; jmp _708 # } # default:error(UDERR); _720: movl $17,%eax pushl %eax call error addl $4,%esp # } # break; jmp _721 _718: jmp _720 _721: _708: jmp _705 # case STRING: # e1=list3(STRING,(int)sptr,symval); _707: cmpl $-27,%eax jne _723 _722: movl symval,%eax pushl %eax movl sptr,%eax pushl %eax movl $-27,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # type=list3(ARRAY,CHAR,symval); movl symval,%eax pushl %eax movl $-2,%eax pushl %eax movl $-5,%eax pushl %eax call list3 addl $12,%esp movl %eax,type # getsym(); call getsym # break; jmp _705 # case CONST: # type= INT; _723: cmpl $7,%eax jne _725 _724: movl $-1,%eax movl %eax,type # e1=list2(CONST,symval); movl symval,%eax pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # getsym(); call getsym # break; jmp _705 # case RETURN: # if (fnptr->sc != FUNCTION) { _725: cmpl $-12,%eax jne _727 _726: movl $-8,%eax movl $4,%ecx movl fnptr,%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _728 # error(STERR); movl $3,%edx pushl %edx call error addl $4,%esp # } # type=list2(POINTER,CODE); _728: movl $-39,%eax pushl %eax movl $-4,%eax pushl %eax call list2 addl $8,%esp movl %eax,type # e1=list2(RETURN,(int)fnptr); movl fnptr,%eax pushl %eax movl $-12,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # getsym(); call getsym # break; jmp _705 # case ENVIRONMENT: # type=list2(POINTER,INT); _727: cmpl $-40,%eax jne _730 _729: movl $-1,%eax pushl %eax movl $-4,%eax pushl %eax call list2 addl $8,%esp movl %eax,type # e1=list2(ENVIRONMENT,0); movl $0,%eax pushl %eax movl $-40,%eax pushl %eax call list2 addl $8,%esp movl %eax,-16(%ebp) # getsym(); call getsym # break; jmp _705 # case LPAR: # if(typeid(getsym())) { _730: cmpl $57,%eax jne _732 _731: call getsym pushl %eax call typeid addl $4,%esp cmpl $0,%eax je _733 # t=typename(); call typename movl %eax,-20(%ebp) # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # e1=expr13(); call expr13 movl %eax,-16(%ebp) # type=t; movl -20(%ebp),%eax movl %eax,type # return e1; movl -16(%ebp),%eax # } jmp _704 # e1=expr0(); _733: call expr0 movl %eax,-16(%ebp) # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # break; jmp _705 # default:error(EXERR); _734: movl $4,%eax pushl %eax call error addl $4,%esp # } # return expr16(e1); jmp _735 _732: jmp _734 _735: _705: movl -16(%ebp),%eax pushl %eax call expr16 addl $4,%esp # } _704: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _736: .size expr14,_736-expr14 # # int # expr16(int e1) # expr16 # 689 # { .align 2 .globl expr16 expr16: .type expr16,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e2,t; # # while(1) { subl $8,%esp _739: # if(sym==LBRA) { movl $59,%eax movl sym,%ecx subl %eax,%ecx jne _740 # e1=rvalue(e1); movl 8(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp movl %eax,8(%ebp) # t=type; movl type,%eax movl %eax,-20(%ebp) # getsym(); call getsym # e2=rvalue(expr0()); call expr0 pushl %eax call rvalue addl $4,%esp movl %eax,-16(%ebp) # checksym(RBRA); movl $60,%eax pushl %eax call checksym addl $4,%esp # e1=binop(ADD,e1,e2,t,type); movl type,%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl 8(%ebp),%eax pushl %eax movl $30,%eax pushl %eax call binop addl $20,%esp movl %eax,8(%ebp) # e1=indop(e1); movl 8(%ebp),%eax pushl %eax call indop addl $4,%esp movl %eax,8(%ebp) # } else if(sym==LPAR) e1=expr15(e1); jmp _741 _740: movl $57,%eax movl sym,%ecx subl %eax,%ecx jne _742 movl 8(%ebp),%ecx pushl %ecx call expr15 addl $4,%esp movl %eax,8(%ebp) # else if(sym==PERIOD) e1=strop(e1); jmp _743 _742: movl $65,%eax movl sym,%ecx subl %eax,%ecx jne _744 movl 8(%ebp),%ecx pushl %ecx call strop addl $4,%esp movl %eax,8(%ebp) # else if(sym==ARROW) e1=strop(indop(rvalue(e1))); jmp _745 _744: movl $66,%eax movl sym,%ecx subl %eax,%ecx jne _746 movl 8(%ebp),%ecx pushl %ecx call rvalue addl $4,%esp pushl %eax call indop addl $4,%esp pushl %eax call strop addl $4,%esp movl %eax,8(%ebp) # else break; jmp _747 _746: jmp _738 # } _747: _745: _743: _741: # if(car(e1)==FNAME) type=list2(POINTER,type); jmp _739 _738: movl $8,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _748 movl type,%eax pushl %eax movl $-4,%eax pushl %eax call list2 addl $8,%esp movl %eax,type # return e1; _748: movl 8(%ebp),%eax # } _737: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _749: .size expr16,_749-expr16 # # int # rvalue(int e) # rvalue # 814 # { .align 2 .globl rvalue rvalue: .type rvalue,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t; # if(type==CHAR) { subl $4,%esp movl $-2,%eax movl type,%ecx subl %eax,%ecx jne _751 # type= INT; movl $-1,%ecx movl %ecx,type # switch(car(e)) { movl 8(%ebp),%ecx pushl %ecx call car addl $4,%esp # case GVAR: # return(list3(CRGVAR,cadr(e),caddr(e))); cmpl $1,%eax jne _754 _753: movl 8(%ebp),%eax pushl %eax call caddr addl $4,%esp pushl %eax movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $3,%eax pushl %eax call list3 addl $12,%esp # case LVAR: jmp _750 # return(list2(CRLVAR,cadr(e))); _754: cmpl $4,%eax jne _756 _755: movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $6,%eax pushl %eax call list2 addl $8,%esp # case INDIRECT: jmp _750 # return(list2(CRINDIRECT,cadr(e))); _756: cmpl $9,%eax jne _758 _757: movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $11,%eax pushl %eax call list2 addl $8,%esp # default:return(e); jmp _750 _759: movl 8(%ebp),%eax # } jmp _750 # } _758: jmp _759 _752: # if(!integral(type)&&type!=VOID) { _751: movl type,%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _760 movl $-37,%eax movl type,%ecx subl %eax,%ecx je _760 # if(type==CODE) { return(e); movl $-39,%ecx movl type,%eax subl %ecx,%eax jne _761 movl 8(%ebp),%eax # } else if((t=car(type))==ARRAY) { jmp _750 _761: movl $-5,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp movl %eax,-16(%ebp) subl %ecx,%eax jne _762 # type=list2(POINTER,cadr(type)); movl type,%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $-4,%eax pushl %eax call list2 addl $8,%esp movl %eax,type # if(car(e)==INDIRECT) return cadr(e); movl $9,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _763 movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp # return list2(ADDRESS,e); jmp _750 _763: movl 8(%ebp),%eax pushl %eax movl $12,%eax pushl %eax call list2 addl $8,%esp # } else if(t==STRUCT || t==UNION) { return e; jmp _750 _762: movl $-6,%eax movl -16(%ebp),%ecx subl %eax,%ecx je _765 movl $-7,%ecx movl -16(%ebp),%eax subl %ecx,%eax jne _764 _765: movl 8(%ebp),%eax # } else if(t!=POINTER) error(TYERR); jmp _750 _764: movl $-4,%eax movl -16(%ebp),%ecx subl %eax,%ecx je _766 movl $15,%ecx pushl %ecx call error addl $4,%esp # } _766: # switch(car(e)) { _760: movl 8(%ebp),%eax pushl %eax call car addl $4,%esp # case GVAR: # return(list3(RGVAR,cadr(e),caddr(e))); cmpl $1,%eax jne _769 _768: movl 8(%ebp),%eax pushl %eax call caddr addl $4,%esp pushl %eax movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $2,%eax pushl %eax call list3 addl $12,%esp # case LVAR: jmp _750 # return(list2(RLVAR,cadr(e))); _769: cmpl $4,%eax jne _771 _770: movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $5,%eax pushl %eax call list2 addl $8,%esp # case INDIRECT: jmp _750 # return(list2(RINDIRECT,cadr(e))); _771: cmpl $9,%eax jne _773 _772: movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $10,%eax pushl %eax call list2 addl $8,%esp # default:return(e); jmp _750 _774: movl 8(%ebp),%eax # } jmp _750 # } _773: jmp _774 _767: _750: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _775: .size rvalue,_775-rvalue # # void # lcheck(int e) # lcheck # 744 # { .align 2 .globl lcheck lcheck: .type lcheck,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t; # if(!scalar(type)|| subl $4,%esp # (car(e)!=GVAR&&car(e)!=LVAR&&car(e)!=INDIRECT&&car(e)!=REGISTER)) movl type,%eax pushl %eax call scalar addl $4,%esp cmpl $0,%eax je _778 movl $1,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _777 movl $4,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _777 movl $9,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _777 movl $-38,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _777 _778: # if ((t=car(type))<0 && t!=STRUCT && t!=UNION) movl $0,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp movl %eax,-16(%ebp) subl %ecx,%eax jge _779 movl $-6,%eax movl -16(%ebp),%ecx subl %eax,%ecx je _779 movl $-7,%ecx movl -16(%ebp),%eax subl %ecx,%eax je _779 # error(LVERR); movl $16,%eax pushl %eax call error addl $4,%esp # } _779: _777: _776: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _780: .size lcheck,_780-lcheck # # int # indop(int e) # indop # 729 # { .align 2 .globl indop indop: .type indop,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(type!=INT&&type!=UNSIGNED) { movl $-1,%eax movl type,%ecx subl %eax,%ecx je _782 movl $-3,%ecx movl type,%eax subl %ecx,%eax je _782 # if(car(type)==POINTER) movl $-4,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _783 # type=cadr(type); movl type,%eax pushl %eax call cadr addl $4,%esp movl %eax,type # else error(TYERR); jmp _784 _783: movl $15,%eax pushl %eax call error addl $4,%esp # } else _784: jmp _785 _782: # type= CHAR; movl $-2,%eax movl %eax,type # if(car(e)==ADDRESS) _785: movl $12,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _786 # return(cadr(e)); movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp # return(list2(INDIRECT,e)); jmp _781 _786: movl 8(%ebp),%eax pushl %eax movl $9,%eax pushl %eax call list2 addl $8,%esp # } _781: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _787: .size indop,_787-indop # # int # strop(int e) # strop # 839 # { .align 2 .globl strop strop: .type strop,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # getsym(); call getsym # if (sym!=IDENT||nptr->sc!=FIELD) error(TYERR); movl $-26,%eax movl sym,%ecx subl %eax,%ecx jne _790 movl $-25,%ecx movl $4,%eax movl nptr,%edx addl %eax,%edx movl (%edx),%edx subl %ecx,%edx je _789 _790: movl $15,%edx pushl %edx call error addl $4,%esp # if (integral(type)||(car(type)!=STRUCT && car(type)!=UNION)) _789: movl type,%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _792 movl $-6,%eax movl type,%edx pushl %edx xchg %edx,%eax call car addl $4,%esp subl %edx,%eax je _791 movl $-7,%eax movl type,%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _791 _792: # e=rvalue(e); movl 8(%ebp),%eax pushl %eax call rvalue addl $4,%esp movl %eax,8(%ebp) # type = nptr->ty; _791: movl $8,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx movl %ecx,type # switch(car(e)) { movl 8(%ebp),%ecx pushl %ecx call car addl $4,%esp # case GVAR: # e=list2(INDIRECT,list3(ADD,e,list2(CONST,nptr->dsp))); cmpl $1,%eax jne _795 _794: movl $12,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx movl $7,%ecx pushl %ecx call list2 addl $8,%esp pushl %eax movl 8(%ebp),%eax pushl %eax movl $30,%eax pushl %eax call list3 addl $12,%esp pushl %eax movl $9,%eax pushl %eax call list2 addl $8,%esp movl %eax,8(%ebp) # break; jmp _793 # case LVAR: # e=list2(car(e),cadr(e) + nptr->dsp); _795: cmpl $4,%eax jne _797 _796: movl $12,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp addl %ecx,%eax pushl %eax movl 8(%ebp),%eax pushl %eax call car addl $4,%esp pushl %eax call list2 addl $8,%esp movl %eax,8(%ebp) # break; jmp _793 # case INDIRECT: # if(!nptr->dsp) break; _797: cmpl $9,%eax jne _799 _798: movl $12,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx cmpl $0,%ecx jne _800 jmp _793 # e=list2(INDIRECT,list3(ADD,cadr(e),list2(CONST,nptr->dsp))); _800: movl $12,%ecx movl nptr,%eax addl %ecx,%eax movl (%eax),%eax pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax movl $30,%eax pushl %eax call list3 addl $12,%esp pushl %eax movl $9,%eax pushl %eax call list2 addl $8,%esp movl %eax,8(%ebp) # break; jmp _793 # default: # e=list2(INDIRECT,list3(ADD,e,list2(CONST,nptr->dsp))); _801: movl $12,%eax movl nptr,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx movl $7,%ecx pushl %ecx call list2 addl $8,%esp pushl %eax movl 8(%ebp),%eax pushl %eax movl $30,%eax pushl %eax call list3 addl $12,%esp pushl %eax movl $9,%eax pushl %eax call list2 addl $8,%esp movl %eax,8(%ebp) # } # getsym(); jmp _802 _799: jmp _801 _802: _793: call getsym # return e; movl 8(%ebp),%eax # } _788: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _803: .size strop,_803-strop # # int # binop(int op, int e1, int e2, int t1, int t2) # binop # 494 # 494 # 494 # 494 # 494 # { .align 2 .globl binop binop: .type binop,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # if(car(e1)==CONST&&car(e2)==CONST) { subl $4,%esp movl $7,%eax movl 12(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _805 movl $7,%eax movl 16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _805 # e1=cadr(e1); movl 12(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,12(%ebp) # e2=cadr(e2); movl 16(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,16(%ebp) # type= INT; movl $-1,%eax movl %eax,type # switch(op) { movl 8(%ebp),%eax # case BOR: # e=e1|e2;break; cmpl $48,%eax jne _808 _807: movl 12(%ebp),%eax movl 16(%ebp),%ecx orl %eax,%ecx movl %ecx,-16(%ebp) jmp _806 # case EOR: # e=e1^e2;break; _808: cmpl $47,%eax jne _810 _809: movl 12(%ebp),%eax movl 16(%ebp),%ecx xorl %eax,%ecx movl %ecx,-16(%ebp) jmp _806 # case BAND: # e=e1&e2;break; _810: cmpl $46,%eax jne _812 _811: movl 12(%ebp),%eax movl 16(%ebp),%ecx andl %eax,%ecx movl %ecx,-16(%ebp) jmp _806 # case ADD: # if(integral(t1)) { _812: cmpl $30,%eax jne _814 _813: movl 20(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _815 # if(integral(t2)) { movl 24(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _816 # e=e1+e2; movl 12(%ebp),%eax movl 16(%ebp),%ecx addl %eax,%ecx movl %ecx,-16(%ebp) # } else { jmp _817 _816: # if(car(t2)!=POINTER) error(TYERR); movl $-4,%ecx movl 24(%ebp),%eax pushl %eax call car addl $4,%esp subl %ecx,%eax je _818 movl $15,%eax pushl %eax call error addl $4,%esp # e=size(cadr(t2))*e1+e2; _818: movl 16(%ebp),%eax movl 12(%ebp),%ecx movl 24(%ebp),%edx pushl %edx xchg %edx,%eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp imull %ecx,%eax addl %edx,%eax movl %eax,-16(%ebp) # type=t2; movl 24(%ebp),%eax movl %eax,type # } # } else { _817: jmp _819 _815: # if(car(t1)!=POINTER) error(TYERR); movl $-4,%eax movl 20(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _820 movl $15,%eax pushl %eax call error addl $4,%esp # e=e1+size(cadr(t1))*e2; _820: movl 12(%ebp),%eax movl 16(%ebp),%edx movl 20(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp imull %edx,%eax addl %ecx,%eax movl %eax,-16(%ebp) # type=t1; movl 20(%ebp),%eax movl %eax,type # } # break; _819: jmp _806 # case SUB: # if(integral(t1)) { _814: cmpl $31,%eax jne _822 _821: movl 20(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _823 # e=e1-e2; movl 16(%ebp),%eax movl 12(%ebp),%ecx subl %eax,%ecx movl %ecx,-16(%ebp) # } else { jmp _824 _823: # if(car(t1)!=POINTER) error(TYERR); movl $-4,%ecx movl 20(%ebp),%edx pushl %edx call car addl $4,%esp subl %ecx,%eax je _825 movl $15,%eax pushl %eax call error addl $4,%esp # e=e1-size(cadr(t1))*e2; _825: movl 16(%ebp),%eax movl 20(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp imull %ecx,%eax movl 12(%ebp),%ecx subl %eax,%ecx movl %ecx,-16(%ebp) # type=t1; movl 20(%ebp),%ecx movl %ecx,type # } # break; _824: jmp _806 # case MUL: # e=e1*e2;break; _822: cmpl $24,%eax jne _827 _826: movl 12(%ebp),%eax movl 16(%ebp),%ecx imull %eax,%ecx movl %ecx,-16(%ebp) jmp _806 # case DIV: # if(!e2) error(EXERR);e=e1/e2;break; _827: cmpl $26,%eax jne _829 _828: cmpl $0,16(%ebp) jne _830 movl $4,%eax pushl %eax call error addl $4,%esp _830: movl 16(%ebp),%eax movl 12(%ebp),%ecx xchg %ecx,%eax cltd divl %ecx movl %eax,-16(%ebp) jmp _806 # case MOD: # if(!e2) error(EXERR);e=e1%e2;break; _829: cmpl $28,%eax jne _832 _831: cmpl $0,16(%ebp) jne _833 movl $4,%eax pushl %eax call error addl $4,%esp _833: movl 16(%ebp),%eax movl 12(%ebp),%ecx xchg %ecx,%eax xor %edx,%edx idivl %ecx movl %edx,-16(%ebp) jmp _806 # case RSHIFT: # e=e1>>e2;break; _832: xchg %edx,%eax cmpl $32,%eax jne _835 _834: movl 16(%ebp),%eax movl 12(%ebp),%ecx xchg %eax,%ecx sarl %cl,%eax movl %eax,-16(%ebp) jmp _806 # case LSHIFT: # e=e1<<e2; _835: cmpl $34,%eax jne _837 _836: movl 16(%ebp),%eax movl 12(%ebp),%ecx xchg %eax,%ecx sall %cl,%eax movl %eax,-16(%ebp) # } # return list2(CONST,e); _837: _806: movl -16(%ebp),%eax pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp # } jmp _804 # if((op==ADD||op==MUL||op==BOR||op==EOR||op==BAND)&& _805: # (car(e1)==CONST||(car(e2)!=CONST&& # (car(e1)==RGVAR||car(e1)==RLVAR)))) { movl $30,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _839 movl $24,%ecx movl 8(%ebp),%eax subl %ecx,%eax je _839 movl $48,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _839 movl $47,%ecx movl 8(%ebp),%eax subl %ecx,%eax je _839 movl $46,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _838 _839: movl $7,%ecx movl 12(%ebp),%eax pushl %eax call car addl $4,%esp subl %ecx,%eax je _840 movl $7,%eax movl 16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _838 movl $2,%eax movl 12(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _841 movl $5,%eax movl 12(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _838 _841: _840: # e=e1;e1=e2;e2=e;e=t1;t1=t2;t2=e; movl 12(%ebp),%eax movl %eax,-16(%ebp) movl 16(%ebp),%eax movl %eax,12(%ebp) movl -16(%ebp),%eax movl %eax,16(%ebp) movl 20(%ebp),%eax movl %eax,-16(%ebp) movl 24(%ebp),%eax movl %eax,20(%ebp) movl -16(%ebp),%eax movl %eax,24(%ebp) # } # if(op==ADD) { _838: movl $30,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _842 # if(integral(t1)) { movl 20(%ebp),%ecx pushl %ecx call integral addl $4,%esp cmpl $0,%eax je _843 # if(integral(t2)) { movl 24(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _844 # if(t1==INT) type=t2;else type=t1; movl $-1,%eax movl 20(%ebp),%ecx subl %eax,%ecx jne _845 movl 24(%ebp),%ecx movl %ecx,type jmp _846 _845: movl 20(%ebp),%ecx movl %ecx,type # return(list3(ADD,e1,e2)); _846: movl 16(%ebp),%ecx pushl %ecx movl 12(%ebp),%ecx pushl %ecx movl $30,%ecx pushl %ecx call list3 addl $12,%esp # } jmp _804 # if(car(t2)!=POINTER) error(TYERR); _844: movl $-4,%eax movl 24(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _847 movl $15,%eax pushl %eax call error addl $4,%esp # e=binop(MUL,e1,list2(CONST,size(cadr(t2))),t1,INT); _847: movl $-1,%eax pushl %eax movl 20(%ebp),%eax pushl %eax movl 24(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl 12(%ebp),%eax pushl %eax movl $24,%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # type=t2; movl 24(%ebp),%eax movl %eax,type # return(list3(ADD,e,e2)); movl 16(%ebp),%eax pushl %eax movl -16(%ebp),%eax pushl %eax movl $30,%eax pushl %eax call list3 addl $12,%esp # } jmp _804 # if(car(t1)!=POINTER||!integral(t2)) error(TYERR); _843: movl $-4,%eax movl 20(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _849 movl 24(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _848 _849: movl $15,%eax pushl %eax call error addl $4,%esp # e=binop(MUL,e2,list2(CONST,size(cadr(t1))),t2,INT); _848: movl $-1,%eax pushl %eax movl 24(%ebp),%eax pushl %eax movl 20(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl 16(%ebp),%eax pushl %eax movl $24,%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # type=t1; movl 20(%ebp),%eax movl %eax,type # if(car(e1)==ADDRESS&&car(e)==CONST&&car(cadr(e1))!=GVAR) movl $12,%eax movl 12(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _850 movl $7,%eax movl -16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax jne _850 movl $1,%eax movl 12(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp pushl %eax call car addl $4,%esp subl %ecx,%eax je _850 # return(list2(ADDRESS,list2(car(cadr(e1)), # cadr(cadr(e1))+cadr(e)))); movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp movl 12(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp pushl %eax call cadr addl $4,%esp addl %ecx,%eax pushl %eax movl 12(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax call car addl $4,%esp pushl %eax call list2 addl $8,%esp pushl %eax movl $12,%eax pushl %eax call list2 addl $8,%esp # return(list3(ADD,e1,e)); jmp _804 _850: movl -16(%ebp),%eax pushl %eax movl 12(%ebp),%eax pushl %eax movl $30,%eax pushl %eax call list3 addl $12,%esp # } jmp _804 # if(op==SUB) { _842: movl $31,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _851 # if(integral(t1)) { movl 20(%ebp),%ecx pushl %ecx call integral addl $4,%esp cmpl $0,%eax je _852 # if(!integral(t2)) error(TYERR); movl 24(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _853 movl $15,%eax pushl %eax call error addl $4,%esp # if(t1==INT) type=t2;else type=t1; _853: movl $-1,%eax movl 20(%ebp),%ecx subl %eax,%ecx jne _854 movl 24(%ebp),%ecx movl %ecx,type jmp _855 _854: movl 20(%ebp),%ecx movl %ecx,type # return(list3(SUB,e1,e2)); _855: movl 16(%ebp),%ecx pushl %ecx movl 12(%ebp),%ecx pushl %ecx movl $31,%ecx pushl %ecx call list3 addl $12,%esp # } jmp _804 # if(car(t1)!=POINTER) error(TYERR); _852: movl $-4,%eax movl 20(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _856 movl $15,%eax pushl %eax call error addl $4,%esp # if(integral(t2)) { _856: movl 24(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _857 # e=binop(MUL,e2,list2(CONST,size(cadr(t1))),t2,INT); movl $-1,%eax pushl %eax movl 24(%ebp),%eax pushl %eax movl 20(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl 16(%ebp),%eax pushl %eax movl $24,%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # type=t1; movl 20(%ebp),%eax movl %eax,type # return(list3(SUB,e1,e)); movl -16(%ebp),%eax pushl %eax movl 12(%ebp),%eax pushl %eax movl $31,%eax pushl %eax call list3 addl $12,%esp # } jmp _804 # if(car(t2)!=POINTER) _857: movl $-4,%eax movl 24(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _858 # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # compatible(t1,t2); _858: movl 24(%ebp),%eax pushl %eax movl 20(%ebp),%eax pushl %eax call compatible addl $8,%esp # e=list3(SUB,e1,e2); movl 16(%ebp),%eax pushl %eax movl 12(%ebp),%eax pushl %eax movl $31,%eax pushl %eax call list3 addl $12,%esp movl %eax,-16(%ebp) # e=binop(DIV,e,list2(CONST,size(cadr(t1))),UNSIGNED,INT); movl $-1,%eax pushl %eax movl $-3,%eax pushl %eax movl 20(%ebp),%eax pushl %eax call cadr addl $4,%esp pushl %eax call size addl $4,%esp pushl %eax movl $7,%eax pushl %eax call list2 addl $8,%esp pushl %eax movl -16(%ebp),%eax pushl %eax movl $26,%eax pushl %eax call binop addl $20,%esp movl %eax,-16(%ebp) # type= INT; movl $-1,%eax movl %eax,type # return e; movl -16(%ebp),%eax # } jmp _804 # if(!integral(t1)||!integral(t2)) error(TYERR); _851: movl 20(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax je _860 movl 24(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _859 _860: movl $15,%eax pushl %eax call error addl $4,%esp # if(t1==INT) type=t2;else type=t1; _859: movl $-1,%eax movl 20(%ebp),%ecx subl %eax,%ecx jne _861 movl 24(%ebp),%ecx movl %ecx,type jmp _862 _861: movl 20(%ebp),%ecx movl %ecx,type # if((op==MUL||op==DIV)&&car(e2)==CONST&&cadr(e2)==1) return e1; _862: movl $24,%ecx movl 8(%ebp),%eax subl %ecx,%eax je _864 movl $26,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _863 _864: movl $7,%ecx movl 16(%ebp),%eax pushl %eax call car addl $4,%esp subl %ecx,%eax jne _863 movl $1,%eax movl 16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call cadr addl $4,%esp subl %ecx,%eax jne _863 movl 12(%ebp),%eax # if(op==BOR||op==EOR||op==BAND) return(list3(op,e1,e2)); jmp _804 _863: movl $48,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _866 movl $47,%ecx movl 8(%ebp),%eax subl %ecx,%eax je _866 movl $46,%eax movl 8(%ebp),%ecx subl %eax,%ecx jne _865 _866: movl 16(%ebp),%ecx pushl %ecx movl 12(%ebp),%ecx pushl %ecx movl 8(%ebp),%ecx pushl %ecx call list3 addl $12,%esp # return(list3(type==UNSIGNED?op+US:op,e1,e2)); jmp _804 _865: movl 16(%ebp),%eax pushl %eax movl 12(%ebp),%eax pushl %eax movl $-3,%eax movl type,%ecx subl %eax,%ecx jne _867 movl $1,%ecx movl 8(%ebp),%eax addl %ecx,%eax jmp _868 _867: movl 8(%ebp),%eax _868: pushl %eax call list3 addl $12,%esp # } _804: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _869: .size binop,_869-binop # # int # expr15(int e1) # expr15 # 684 # { .align 2 .globl expr15 expr15: .type expr15,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t,arglist; # # t=type; subl $8,%esp movl type,%eax movl %eax,-16(%ebp) # if(integral(t)|| (car(t)!=FUNCTION && car(t)!=CODE)) movl -16(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _872 movl $-8,%eax movl -16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _871 movl $-39,%eax movl -16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _871 _872: # error(TYERR); movl $15,%eax pushl %eax call error addl $4,%esp # getsym(); _871: call getsym # arglist=0; movl $0,%eax movl %eax,-20(%ebp) # while(sym!=RPAR) { _874: movl $58,%eax movl sym,%ecx subl %eax,%ecx je _873 # arglist=list2(rvalue(expr1()),arglist); movl -20(%ebp),%ecx pushl %ecx call expr1 pushl %eax call rvalue addl $4,%esp pushl %eax call list2 addl $8,%esp movl %eax,-20(%ebp) # if(sym!=COMMA) break; movl $56,%eax movl sym,%ecx subl %eax,%ecx je _875 jmp _873 # getsym(); _875: call getsym # } # checksym(RPAR); jmp _874 _873: movl $58,%eax pushl %eax call checksym addl $4,%esp # if(car(t)!=CODE) { movl $-39,%eax movl -16(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _876 # t=cadr(t); movl -16(%ebp),%eax pushl %eax call cadr addl $4,%esp movl %eax,-16(%ebp) # if(t==CHAR) type= INT;else type=t; movl $-2,%eax movl -16(%ebp),%ecx subl %eax,%ecx jne _877 movl $-1,%ecx movl %ecx,type jmp _878 _877: movl -16(%ebp),%ecx movl %ecx,type # } _878: # return list3(FUNCTION,e1,arglist); _876: movl -20(%ebp),%ecx pushl %ecx movl 8(%ebp),%ecx pushl %ecx movl $-8,%ecx pushl %ecx call list3 addl $12,%esp # } _870: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _879: .size expr15,_879-expr15 # # int # typeid(int s) # typeid # 844 # { .align 2 .globl typeid typeid: .type typeid,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return (integral(s) || s==CODE || s==SHORT || s==LONG || s==STRUCT || s==UNION || # (s==IDENT && nptr->sc==TYPE)); movl 8(%ebp),%eax pushl %eax call integral addl $4,%esp cmpl $0,%eax jne _881 movl $-39,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _881 movl $-35,%ecx movl 8(%ebp),%eax subl %ecx,%eax je _881 movl $-34,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _881 movl $-6,%ecx movl 8(%ebp),%eax subl %ecx,%eax je _881 movl $-7,%eax movl 8(%ebp),%ecx subl %eax,%ecx je _881 movl $-26,%ecx movl 8(%ebp),%eax subl %ecx,%eax jne _882 movl $-33,%eax movl $4,%ecx movl nptr,%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx je _881 _882: xorl %edx,%edx jmp _883 _881: movl $1,%edx _883: # } movl %edx,%eax _880: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _884: .size typeid,_884-typeid # # int # typename(void) # typename # 849 # { .align 2 .globl typename typename: .type typename,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int t; # # type=t=typespec(); subl $4,%esp call typespec movl %eax,-16(%ebp) movl %eax,type # ndecl0(); call ndecl0 # reverse(t); movl -16(%ebp),%eax pushl %eax call reverse addl $4,%esp # return type; movl type,%eax # } _885: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _886: .size typename,_886-typename # # int # ndecl0(void) # ndecl0 # 774 # { .align 2 .globl ndecl0 ndecl0: .type ndecl0,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(sym==MUL) { movl $24,%eax movl sym,%ecx subl %eax,%ecx jne _888 # getsym(); call getsym # return type=list2(POINTER,ndecl0()); call ndecl0 pushl %eax movl $-4,%eax pushl %eax call list2 addl $8,%esp movl %eax,type # } jmp _887 # return ndecl1(); _888: call ndecl1 # } _887: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _889: .size ndecl0,_889-ndecl0 # # int # ndecl1(void) # ndecl1 # 779 # { .align 2 .globl ndecl1 ndecl1: .type ndecl1,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int i,t,arglist; # # if(sym==LPAR) { subl $12,%esp movl $57,%eax movl sym,%ecx subl %eax,%ecx jne _891 # if(getsym()==RPAR) { movl $58,%ecx call getsym subl %ecx,%eax jne _892 # type=list3(FUNCTION,type,0); getsym(); movl $0,%eax pushl %eax movl type,%eax pushl %eax movl $-8,%eax pushl %eax call list3 addl $12,%esp movl %eax,type call getsym # } else { jmp _893 _892: # ndecl0(); call ndecl0 # checksym(RPAR); movl $58,%eax pushl %eax call checksym addl $4,%esp # } # } _893: # while(1) { _891: _895: # if(sym==LBRA) { movl $59,%eax movl sym,%ecx subl %eax,%ecx jne _896 # getsym(); call getsym # t=type; movl type,%eax movl %eax,-20(%ebp) # i=cexpr(expr()); call expr pushl %eax call cexpr addl $4,%esp movl %eax,-16(%ebp) # checksym(RBRA); movl $60,%eax pushl %eax call checksym addl $4,%esp # type=list3(ARRAY,t,i); movl -16(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl $-5,%eax pushl %eax call list3 addl $12,%esp movl %eax,type # } else if(sym==LPAR) { jmp _897 _896: movl $57,%eax movl sym,%ecx subl %eax,%ecx jne _898 # t = type; movl type,%ecx movl %ecx,-20(%ebp) # getsym(); call getsym # arglist=0; movl $0,%eax movl %eax,-24(%ebp) # while(sym!=RPAR) { _900: movl $58,%eax movl sym,%ecx subl %eax,%ecx je _899 # ndecl0(); call ndecl0 # arglist=list2(type,arglist); movl -24(%ebp),%eax pushl %eax movl type,%eax pushl %eax call list2 addl $8,%esp movl %eax,-24(%ebp) # if(sym!=COMMA) break; movl $56,%eax movl sym,%ecx subl %eax,%ecx je _901 jmp _899 # getsym(); _901: call getsym # } # checksym(RPAR); jmp _900 _899: movl $58,%eax pushl %eax call checksym addl $4,%esp # type=list3(FUNCTION,t,arglist); movl -24(%ebp),%eax pushl %eax movl -20(%ebp),%eax pushl %eax movl $-8,%eax pushl %eax call list3 addl $12,%esp movl %eax,type # } # else return type; jmp _902 _898: movl type,%eax # } jmp _890 _902: _897: # } jmp _895 _894: _890: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _903: .size ndecl1,_903-ndecl1 # # int # cexpr(int e) # cexpr # 859 # { .align 2 .globl cexpr cexpr: .type cexpr,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if (car(e) != CONST) error(CNERR); movl $7,%eax movl 8(%ebp),%ecx pushl %ecx xchg %ecx,%eax call car addl $4,%esp subl %ecx,%eax je _905 movl $5,%eax pushl %eax call error addl $4,%esp # return (cadr(e)); _905: movl 8(%ebp),%eax pushl %eax call cadr addl $4,%esp # } _904: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _906: .size cexpr,_906-cexpr # # int # getsym(void) # getsym # 724 # { .align 2 .globl getsym getsym: .type getsym,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *nptr0,*nptr1; # int i; # char c; # # if (alpha(skipspc())) { subl $13,%esp call skipspc pushl %eax call alpha addl $4,%esp cmpl $0,%eax je _908 # i = hash = 0; movl $0,%eax movl %eax,hash movl %eax,-24(%ebp) # name = namebuf; movl $namebuf,%eax movl %eax,name # while (alpha(ch) || digit(ch)) { _910: movl ch,%eax pushl %eax call alpha addl $4,%esp cmpl $0,%eax jne _911 movl ch,%eax pushl %eax call digit addl $4,%esp cmpl $0,%eax je _909 _911: # if (i < LBUFSIZE-1) movl $4095,%eax movl -24(%ebp),%ecx subl %eax,%ecx jge _912 # hash=(7*hash ^ (name[i++]=ch)); movl ch,%ecx movl name,%eax lea -24(%ebp),%edx pushl %edx popl %ebx movl (%ebx),%edx addl $1,(%ebx) addl %eax,%edx movb %ecx,(%edx) movl %ecx,%edx movl $7,%eax movl hash,%ecx imull %eax,%ecx xorl %edx,%ecx movl %ecx,hash # getch(); _912: call getch # } # name[i++] = '\0'; jmp _910 _909: movl $0,%eax movl name,%ecx lea -24(%ebp),%edx pushl %edx popl %ebx movl (%ebx),%edx addl $1,(%ebx) addl %ecx,%edx movb %eax,(%edx) movl %eax,%edx # nptr0 = gsearch(); call gsearch movl %eax,-16(%ebp) # if (nptr0->sc == RESERVE) return sym = nptr0->dsp; movl $-23,%eax movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _913 movl $12,%edx movl -16(%ebp),%ecx addl %edx,%ecx movl (%ecx),%ecx movl %ecx,sym # if (nptr0->sc == MACRO && !mflag) { movl %ecx,%eax jmp _907 _913: movl $-28,%eax movl $4,%edx movl -16(%ebp),%ecx addl %edx,%ecx movl (%ecx),%ecx subl %eax,%ecx jne _914 cmpl $0,mflag jne _914 # mflag++; movl $mflag,%ecx movl (%ecx),%eax addl $1,(%ecx) # chsave = ch; movl ch,%eax movl %eax,chsave # chptrsave = chptr; movl chptr,%eax movl %eax,chptrsave # chptr = (char *)nptr0->dsp; movl $12,%eax movl -16(%ebp),%edx addl %eax,%edx movl (%edx),%edx movl %edx,chptr # getch(); call getch # return getsym(); call getsym # } jmp _907 # sym = IDENT; _914: movl $-26,%eax movl %eax,sym # gnptr=nptr=nptr0; movl -16(%ebp),%eax movl %eax,nptr movl %eax,gnptr # if (mode==ADECL && nptr0->sc ==TYPE) return sym; movl $4,%eax movl mode,%edx subl %eax,%edx jne _915 movl $-33,%edx movl $4,%eax movl -16(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx subl %edx,%ecx jne _915 movl sym,%ecx # if (mode==GDECL || mode==GSDECL || mode==GUDECL || movl %ecx,%eax jmp _907 _915: # mode==GTDECL || mode==TOP) { movl $1,%eax movl mode,%edx subl %eax,%edx je _917 movl $2,%edx movl mode,%ecx subl %edx,%ecx je _917 movl $3,%ecx movl mode,%edx subl %ecx,%edx je _917 movl $10,%edx movl mode,%ecx subl %edx,%ecx je _917 movl $0,%ecx movl mode,%edx subl %ecx,%edx jne _916 _917: # return sym; movl sym,%edx # } movl %edx,%eax jmp _907 # nptr1=lsearch(nptr0->nm); _916: movl -16(%ebp),%eax movl (%eax),%eax pushl %eax call lsearch addl $4,%esp movl %eax,-20(%ebp) # if (mode==STAT) movl $9,%eax movl mode,%ecx subl %eax,%ecx jne _918 # if (nptr1->sc == EMPTY) return sym; movl $-9,%ecx movl $4,%eax movl -20(%ebp),%edx addl %eax,%edx movl (%edx),%edx subl %ecx,%edx jne _919 movl sym,%edx # else { nptr=nptr1; return sym;} movl %edx,%eax jmp _907 _919: movl -20(%ebp),%eax movl %eax,nptr movl sym,%eax jmp _907 # nptr=nptr1; _918: movl -20(%ebp),%eax movl %eax,nptr # return sym; movl sym,%eax # } else if (digit(ch)) { jmp _907 _908: movl ch,%eax pushl %eax call digit addl $4,%esp cmpl $0,%eax je _920 # symval=0; movl $0,%eax movl %eax,symval # if (ch == '0') { movl $48,%eax movl ch,%edx subl %eax,%edx jne _921 # if (getch() == 'x' || ch == 'X') { movl $120,%edx call getch subl %edx,%eax je _923 movl $88,%eax movl ch,%edx subl %eax,%edx jne _922 _923: # while(1) { _925: # if(digit(getch())) call getch pushl %eax call digit addl $4,%esp cmpl $0,%eax je _926 # symval=symval*16+ch-'0'; movl $48,%eax movl ch,%edx movl $16,%ecx pushl %ecx movl symval,%ecx popl %ebx imull %ebx,%ecx addl %edx,%ecx subl %eax,%ecx movl %ecx,symval # else if('a'<=ch&&ch<='f') jmp _927 _926: movl ch,%ecx movl $97,%eax subl %ecx,%eax jg _928 movl $102,%eax movl ch,%edx subl %eax,%edx jg _928 # symval=symval*16+ch-'a'+10; movl $10,%edx movl $97,%eax movl ch,%ecx pushl %ecx movl $16,%ecx pushl %ecx movl symval,%ecx popl %ebx imull %ebx,%ecx popl %ebx addl %ebx,%ecx subl %eax,%ecx addl %edx,%ecx movl %ecx,symval # else if('A'<=ch&&ch<='F') jmp _929 _928: movl ch,%ecx movl $65,%eax subl %ecx,%eax jg _930 movl $70,%eax movl ch,%edx subl %eax,%edx jg _930 # symval=symval*16+ch-'A'+10; movl $10,%edx movl $65,%eax movl ch,%ecx pushl %ecx movl $16,%ecx pushl %ecx movl symval,%ecx popl %ebx imull %ebx,%ecx popl %ebx addl %ebx,%ecx subl %eax,%ecx addl %edx,%ecx movl %ecx,symval # else break; jmp _931 _930: jmp _924 # } _931: _929: _927: # } else { jmp _925 _924: jmp _932 _922: # while (digit(ch)) { _934: movl ch,%ecx pushl %ecx call digit addl $4,%esp cmpl $0,%eax je _933 # symval=symval*8+ch-'0';getch(); movl $48,%eax movl ch,%ecx movl $8,%edx pushl %edx movl symval,%edx popl %ebx imull %ebx,%edx addl %ecx,%edx subl %eax,%edx movl %edx,symval call getch # } # } jmp _934 _933: # } else { _932: jmp _935 _921: # while(digit(ch)) { _937: movl ch,%eax pushl %eax call digit addl $4,%esp cmpl $0,%eax je _936 # symval=symval*10+ch-'0';getch(); movl $48,%eax movl ch,%ecx movl $10,%edx pushl %edx movl symval,%edx popl %ebx imull %ebx,%edx addl %ecx,%edx subl %eax,%edx movl %edx,symval call getch # } # } jmp _937 _936: # return sym=CONST; _935: movl $7,%eax movl %eax,sym # } else if(ch=='\'') { jmp _907 _920: movl $39,%eax movl ch,%ecx subl %eax,%ecx jne _938 # getch(); call getch # symval=escape(); call escape movl %eax,symval # if(ch!='\'') error(CHERR); movl $39,%eax movl ch,%edx subl %eax,%edx je _939 movl $6,%edx pushl %edx call error addl $4,%esp # getch(); _939: call getch # return sym=CONST; movl $7,%eax movl %eax,sym # } else if(ch=='"') { jmp _907 _938: movl $34,%eax movl ch,%edx subl %eax,%edx jne _940 # getstring(); call getstring # return sym= STRING; movl $-27,%eax movl %eax,sym # } jmp _907 # c=ch; _940: movl ch,%eax movb %eax,-25(%ebp) # getch(); call getch # switch(c) { movsbl -25(%ebp),%eax # case '*': # return postequ(MUL,MUL+AS); cmpl $42,%eax jne _943 _942: movl $124,%eax pushl %eax movl $24,%eax pushl %eax call postequ addl $8,%esp # case '&': jmp _907 # if(ch=='&') {getch();return sym=LAND;} _943: cmpl $38,%eax jne _945 _944: movl $38,%eax movl ch,%edx subl %eax,%edx jne _946 call getch movl $49,%eax movl %eax,sym jmp _907 # return postequ(BAND,BAND+AS); _946: movl $146,%eax pushl %eax movl $46,%eax pushl %eax call postequ addl $8,%esp # case '-': jmp _907 # if(ch=='>') {getch();return sym=ARROW;} _945: cmpl $45,%eax jne _948 _947: movl $62,%eax movl ch,%edx subl %eax,%edx jne _949 call getch movl $66,%eax movl %eax,sym jmp _907 # if(ch=='-') {getch();return sym=DEC;} _949: movl $45,%eax movl ch,%edx subl %eax,%edx jne _950 call getch movl $21,%eax movl %eax,sym jmp _907 # return postequ(SUB,SUB+AS); _950: movl $131,%eax pushl %eax movl $31,%eax pushl %eax call postequ addl $8,%esp # case '!': jmp _907 # return postequ(LNOT,NEQ); _948: cmpl $33,%eax jne _952 _951: movl $45,%eax pushl %eax movl $14,%eax pushl %eax call postequ addl $8,%esp # case '~': jmp _907 # return sym=BNOT; _952: cmpl $126,%eax jne _954 _953: movl $15,%eax movl %eax,sym # case '+': jmp _907 # if(ch=='+') {getch();return sym=INC;} _954: cmpl $43,%eax jne _956 _955: movl $43,%eax movl ch,%edx subl %eax,%edx jne _957 call getch movl $16,%eax movl %eax,sym jmp _907 # return postequ(ADD,ADD+AS); _957: movl $130,%eax pushl %eax movl $30,%eax pushl %eax call postequ addl $8,%esp # case '%': jmp _907 # return postequ(MOD,MOD+AS); _956: cmpl $37,%eax jne _959 _958: movl $128,%eax pushl %eax movl $28,%eax pushl %eax call postequ addl $8,%esp # case '^': jmp _907 # return postequ(EOR,EOR+AS); _959: cmpl $94,%eax jne _961 _960: movl $147,%eax pushl %eax movl $47,%eax pushl %eax call postequ addl $8,%esp # case '|': jmp _907 # if(ch=='|') {getch();return sym=LOR;} _961: cmpl $124,%eax jne _963 _962: movl $124,%eax movl ch,%edx subl %eax,%edx jne _964 call getch movl $50,%eax movl %eax,sym jmp _907 # return postequ(BOR,BOR+AS); _964: movl $148,%eax pushl %eax movl $48,%eax pushl %eax call postequ addl $8,%esp # case '=': jmp _907 # return postequ(ASS,EQ); _963: cmpl $61,%eax jne _966 _965: movl $44,%eax pushl %eax movl $52,%eax pushl %eax call postequ addl $8,%esp # case '>': jmp _907 # if(ch=='>') {getch();return postequ(RSHIFT,RSHIFT+AS);} _966: cmpl $62,%eax jne _968 _967: movl $62,%eax movl ch,%edx subl %eax,%edx jne _969 call getch movl $132,%eax pushl %eax movl $32,%eax pushl %eax call postequ addl $8,%esp jmp _907 # return postequ(GT,GE); _969: movl $38,%eax pushl %eax movl $36,%eax pushl %eax call postequ addl $8,%esp # case '<': jmp _907 # if(ch=='<') {getch();return postequ(LSHIFT,LSHIFT+AS);} _968: cmpl $60,%eax jne _971 _970: movl $60,%eax movl ch,%edx subl %eax,%edx jne _972 call getch movl $134,%eax pushl %eax movl $34,%eax pushl %eax call postequ addl $8,%esp jmp _907 # return postequ(LT,LE); _972: movl $42,%eax pushl %eax movl $40,%eax pushl %eax call postequ addl $8,%esp # case '(': jmp _907 # return sym=LPAR; _971: cmpl $40,%eax jne _974 _973: movl $57,%eax movl %eax,sym # case ')': jmp _907 # return sym=RPAR; _974: cmpl $41,%eax jne _976 _975: movl $58,%eax movl %eax,sym # case '[': jmp _907 # return sym=LBRA; _976: cmpl $91,%eax jne _978 _977: movl $59,%eax movl %eax,sym # case ']': jmp _907 # return sym=RBRA; _978: cmpl $93,%eax jne _980 _979: movl $60,%eax movl %eax,sym # case '{': jmp _907 # return sym=LC; _980: cmpl $123,%eax jne _982 _981: movl $61,%eax movl %eax,sym # case '}': jmp _907 # return sym=RC; _982: cmpl $125,%eax jne _984 _983: movl $62,%eax movl %eax,sym # case ',': jmp _907 # return sym=COMMA; _984: cmpl $44,%eax jne _986 _985: movl $56,%eax movl %eax,sym # case ';': jmp _907 # return sym=SM; _986: cmpl $59,%eax jne _988 _987: movl $64,%eax movl %eax,sym # case ':': jmp _907 # return sym=COLON; _988: cmpl $58,%eax jne _990 _989: movl $63,%eax movl %eax,sym # case '?': jmp _907 # return sym=COND; _990: cmpl $63,%eax jne _992 _991: movl $51,%eax movl %eax,sym # case '.': jmp _907 # if(ch=='.') { _992: cmpl $46,%eax jne _994 _993: movl $46,%eax movl ch,%edx subl %eax,%edx jne _995 # getch(); call getch # if (ch=='.') { movl $46,%eax movl ch,%edx subl %eax,%edx jne _996 # getch(); call getch # return sym=DOTS; movl $69,%eax movl %eax,sym # } jmp _907 # error(CHERR); _996: movl $6,%eax pushl %eax call error addl $4,%esp # return getsym(); call getsym # } else jmp _907 _995: # return sym=PERIOD; movl $65,%eax movl %eax,sym # case '/': jmp _907 # if(ch!='*') return postequ(DIV,DIV+AS); _994: cmpl $47,%eax jne _998 _997: movl $42,%eax movl ch,%edx subl %eax,%edx je _999 movl $126,%edx pushl %edx movl $26,%edx pushl %edx call postequ addl $8,%esp # getch(); jmp _907 _999: call getch # while(ch=='*'?getch()!='/':getch()); _1001: movl $42,%eax movl ch,%edx subl %eax,%edx jne _1002 movl $47,%edx call getch subl %edx,%eax jne _1003 xorl %eax,%eax jmp _1004 _1003: movl $1,%eax _1004: jmp _1005 _1002: call getch _1005: cmpl $0,%eax jne _1001 # getch(); _1000: call getch # return getsym(); call getsym # default: jmp _907 # error(CHERR); _1006: movl $6,%eax pushl %eax call error addl $4,%esp # return getsym(); call getsym # } jmp _907 # } _998: jmp _1006 _941: _907: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1007: .size getsym,_1007-getsym # # int # postequ(int s1, int s2) # postequ # 794 # 794 # { .align 2 .globl postequ postequ: .type postequ,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(ch=='=') {getch();return sym=s2;} movl $61,%eax movl ch,%ecx subl %eax,%ecx jne _1009 call getch movl 12(%ebp),%eax movl %eax,sym jmp _1008 # return sym=s1; _1009: movl 8(%ebp),%eax movl %eax,sym # } _1008: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1010: .size postequ,_1010-postequ # # int # alpha(char c) # alpha # 489 # { .align 2 .globl alpha alpha: .type alpha,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return(('a'<=c&&c<='z')||('A'<=c&&c<='Z')||c=='_'); movsbl 8(%ebp),%eax movl $97,%ecx subl %eax,%ecx jg _1013 movl $122,%ecx movsbl 8(%ebp),%eax subl %ecx,%eax jle _1012 _1013: movsbl 8(%ebp),%eax movl $65,%ecx subl %eax,%ecx jg _1014 movl $90,%ecx movsbl 8(%ebp),%eax subl %ecx,%eax jle _1012 _1014: movl $95,%eax movsbl 8(%ebp),%ecx subl %eax,%ecx je _1012 xorl %ecx,%ecx jmp _1015 _1012: movl $1,%ecx _1015: # } movl %ecx,%eax _1011: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1016: .size alpha,_1016-alpha # # int # digit(char c) # digit # 529 # { .align 2 .globl digit digit: .type digit,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return('0'<=c&&c<='9'); movsbl 8(%ebp),%eax movl $48,%ecx subl %eax,%ecx jg _1019 movl $57,%ecx movsbl 8(%ebp),%eax subl %ecx,%eax jle _1018 _1019: xorl %eax,%eax jmp _1020 _1018: movl $1,%eax _1020: # } _1017: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1021: .size digit,_1021-digit # # # NMTBL * # gsearch(void) # gsearch # 446 # { .align 2 .globl gsearch gsearch: .type gsearch,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *nptr,*iptr; # # iptr=nptr= &ntable[hash % GSYMS]; subl $8,%esp movl $16,%eax movl $9000,%ecx movl hash,%edx xchg %edx,%eax xchg %ebx,%edx xor %edx,%edx idivl %ecx imull %ebx,%edx movl $ntable,%ebx addl %edx,%ebx movl %ebx,-16(%ebp) movl %ebx,-20(%ebp) # while(nptr->sc!=0 && neqname(nptr->nm)) { _1024: movl $0,%ebx movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %ebx,%edx je _1023 movl -16(%ebp),%edx movl (%edx),%edx pushl %edx xchg %edx,%eax call neqname addl $4,%esp cmpl $0,%eax je _1023 # if (++nptr== &ntable[GSYMS]) movl $144000,%eax movl $ntable,%ebx addl %eax,%ebx lea -16(%ebp),%ecx addl $16,(%ecx) movl (%ecx),%ecx subl %ebx,%ecx jne _1025 # nptr=ntable; movl $ntable,%ecx movl %ecx,-16(%ebp) # if (nptr==iptr) error(GSERR); _1025: movl -20(%ebp),%ecx movl -16(%ebp),%ebx subl %ecx,%ebx jne _1026 movl $7,%ebx pushl %ebx call error addl $4,%esp # } _1026: # if (nptr->sc == 0) { jmp _1024 _1023: movl $0,%eax movl $4,%ecx movl -16(%ebp),%ebx addl %ecx,%ebx movl (%ebx),%ebx subl %eax,%ebx jne _1027 # copy(nptr,name); movl name,%ebx pushl %ebx movl -16(%ebp),%ebx pushl %ebx call copy addl $8,%esp # nptr->sc=EMPTY; movl $-9,%eax movl $4,%ebx movl -16(%ebp),%ecx addl %ebx,%ecx movl %eax,(%ecx) movl %eax,%ecx # } # return nptr; _1027: movl -16(%ebp),%ecx # } movl %ecx,%eax _1022: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1028: .size gsearch,_1028-gsearch # # NMTBL * # lsearch(char *name) # lsearch # 439 # { .align 2 .globl lsearch lsearch: .type lsearch,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # NMTBL *nptr,*iptr; # # iptr=nptr= &ntable[hash%LSYMS+GSYMS]; subl $8,%esp movl $16,%eax movl $9000,%ecx movl $500,%edx pushl %edx movl hash,%edx popl %ebx pushl %ebx xchg %edx,%eax xchg %ebx,%edx xor %edx,%edx idivl (%esp) addl $4,%esp addl %ecx,%edx imull %ebx,%edx movl $ntable,%ebx addl %edx,%ebx movl %ebx,-16(%ebp) movl %ebx,-20(%ebp) # while(nptr->sc!=0 && neqname(nptr->nm)) { _1031: movl $0,%ebx movl $4,%ecx movl -16(%ebp),%edx addl %ecx,%edx movl (%edx),%edx subl %ebx,%edx je _1030 movl -16(%ebp),%edx movl (%edx),%edx pushl %edx xchg %edx,%eax call neqname addl $4,%esp cmpl $0,%eax je _1030 # if (++nptr== &ntable[LSYMS+GSYMS]) movl $152000,%eax movl $ntable,%ebx addl %eax,%ebx lea -16(%ebp),%ecx addl $16,(%ecx) movl (%ecx),%ecx subl %ebx,%ecx jne _1032 # nptr= &ntable[GSYMS]; movl $144000,%ecx movl $ntable,%ebx addl %ecx,%ebx movl %ebx,-16(%ebp) # if (nptr==iptr) error(LSERR); _1032: movl -20(%ebp),%ebx movl -16(%ebp),%ecx subl %ebx,%ecx jne _1033 movl $8,%ecx pushl %ecx call error addl $4,%esp # } _1033: # if (nptr->sc == 0) { jmp _1031 _1030: movl $0,%eax movl $4,%ebx movl -16(%ebp),%ecx addl %ebx,%ecx movl (%ecx),%ecx subl %eax,%ecx jne _1034 # nptr->nm=name; /* already saved in gsearch */ movl 8(%ebp),%ecx movl -16(%ebp),%ebx movl %ecx,(%ebx) movl %ecx,%ebx # nptr->sc=EMPTY; movl $-9,%ebx movl $4,%eax movl -16(%ebp),%ecx addl %eax,%ecx movl %ebx,(%ecx) movl %ebx,%ecx # nptr->dsp=0; movl $0,%ecx movl $12,%ebx movl -16(%ebp),%eax addl %ebx,%eax movl %ecx,(%eax) movl %ecx,%eax # } # return nptr; _1034: movl -16(%ebp),%eax # } _1029: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1035: .size lsearch,_1035-lsearch # # void # copy(NMTBL *nptr, char *s) # copy # 594 # 594 # { .align 2 .globl copy copy: .type copy,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # nptr->nm = cheapp; movl cheapp,%eax movl 8(%ebp),%ecx movl %eax,(%ecx) movl %eax,%ecx # while(*cheapp++ = *s++); _1038: lea 12(%ebp),%ecx movl (%ecx),%eax addl $1,(%ecx) movsbl (%eax),%eax movl $cheapp,%ecx movl (%ecx),%edx addl $1,(%ecx) movb %eax,(%edx) movl %eax,%edx cmpl $0,%edx jne _1038 # } _1037: movl %edx,%eax _1036: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1039: .size copy,_1039-copy # # int # neqname(char *p) # neqname # 784 # { .align 2 .globl neqname neqname: .type neqname,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # char *q; # # if (!p) subl $4,%esp cmpl $0,8(%ebp) jne _1041 # return 0; movl $0,%eax # q=name; jmp _1040 _1041: movl name,%eax movl %eax,-16(%ebp) # while(*p && *p!='.') _1043: # if(*p++ != *q++) return 1; movl 8(%ebp),%eax movsbl (%eax),%eax cmpl $0,%eax je _1042 movl $46,%eax movl 8(%ebp),%ecx movsbl (%ecx),%ecx subl %eax,%ecx je _1042 lea -16(%ebp),%ecx movl (%ecx),%eax addl $1,(%ecx) movsbl (%eax),%eax lea 8(%ebp),%ecx movl (%ecx),%edx addl $1,(%ecx) movsbl (%edx),%edx subl %eax,%edx je _1044 movl $1,%edx # return (*q!=0); movl %edx,%eax jmp _1040 _1044: jmp _1043 _1042: movl $0,%eax movl -16(%ebp),%edx movsbl (%edx),%edx subl %eax,%edx jne _1045 xorl %edx,%edx jmp _1046 _1045: movl $1,%edx _1046: # } movl %edx,%eax _1040: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1047: .size neqname,_1047-neqname # # void # getstring(void) # getstring # 719 # { .align 2 .globl getstring getstring: .type getstring,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # getch(); call getch # symval = 0; movl $0,%eax movl %eax,symval # sptr = cheapp; movl cheapp,%eax movl %eax,sptr # while (ch != '"') { _1050: movl $34,%eax movl ch,%ecx subl %eax,%ecx je _1049 # *cheapp++ = escape(); call escape movl $cheapp,%ecx movl (%ecx),%edx addl $1,(%ecx) movb %eax,(%edx) movl %eax,%edx # symval++; movl $symval,%edx movl (%edx),%ecx addl $1,(%edx) # if (cheapp >= cheap+CHEAPSIZE) error(STRERR); movl $256000,%ecx movl $cheap,%eax addl %ecx,%eax movl cheapp,%ecx subl %eax,%ecx jb _1051 movl $9,%ecx pushl %ecx call error addl $4,%esp # } _1051: # getch(); jmp _1050 _1049: call getch # *cheapp++ = '\0'; movl $0,%eax movl $cheapp,%ecx movl (%ecx),%edx addl $1,(%ecx) movb %eax,(%edx) movl %eax,%edx # symval++; movl $symval,%edx movl (%edx),%eax addl $1,(%edx) # } _1048: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1052: .size getstring,_1052-getstring # # int # skipspc(void) # skipspc # 829 # { .align 2 .globl skipspc skipspc: .type skipspc,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # while(ch=='\t'||ch=='\n'||ch==' '||ch=='\r') _1055: # getch(); movl $9,%eax movl ch,%ecx subl %eax,%ecx je _1056 movl $10,%ecx movl ch,%eax subl %ecx,%eax je _1056 movl $32,%eax movl ch,%ecx subl %eax,%ecx je _1056 movl $13,%ecx movl ch,%eax subl %ecx,%eax jne _1054 _1056: call getch # return ch; jmp _1055 _1054: movl ch,%eax # } _1053: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1057: .size skipspc,_1057-skipspc # # int # getch(void) # getch # 704 # { .align 2 .globl getch getch: .type getch,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # if(*chptr) return ch= *chptr++; movl chptr,%eax movsbl (%eax),%eax cmpl $0,%eax je _1059 movl $chptr,%eax movl (%eax),%ecx addl $1,(%eax) movsbl (%ecx),%ecx movl %ecx,ch # if(mflag) { movl %ecx,%eax jmp _1058 _1059: cmpl $0,mflag je _1060 # mflag=0;chptr=chptrsave;return ch=chsave; movl $0,%eax movl %eax,mflag movl chptrsave,%eax movl %eax,chptr movl chsave,%eax movl %eax,ch # } jmp _1058 # getline(); _1060: call getline # return getch(); call getch # } _1058: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1061: .size getch,_1061-getch # # char # escape(void) # escape # 394 # { .align 2 .globl escape escape: .type escape,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # char c; # if ((c=ch) == '\\') { subl $1,%esp movl $92,%eax movl ch,%ecx movb %ecx,-13(%ebp) subl %eax,%ecx jne _1063 # if (digit(c=getch())) { call getch movb %eax,-13(%ebp) pushl %eax call digit addl $4,%esp cmpl $0,%eax je _1064 # c = ch-'0'; movl $48,%eax movl ch,%ecx subl %eax,%ecx movb %ecx,-13(%ebp) # if (digit(getch())) { call getch pushl %eax call digit addl $4,%esp cmpl $0,%eax je _1065 # c = c*8+ch-'0'; movl $48,%eax movl ch,%ecx movl $8,%edx pushl %edx movsbl -13(%ebp),%edx popl %ebx imull %ebx,%edx addl %ecx,%edx subl %eax,%edx movb %edx,-13(%ebp) # if (digit(getch())) { call getch pushl %eax call digit addl $4,%esp cmpl $0,%eax je _1066 # c=c*8+ch-'0';getch(); movl $48,%eax movl ch,%edx movl $8,%ecx pushl %ecx movsbl -13(%ebp),%ecx popl %ebx imull %ebx,%ecx addl %edx,%ecx subl %eax,%ecx movb %ecx,-13(%ebp) call getch # } # } _1066: # return c; _1065: movsbl -13(%ebp),%eax # } jmp _1062 # getch(); _1064: call getch # switch(c) { movsbl -13(%ebp),%eax # case 'n': # return '\n'; cmpl $110,%eax jne _1069 _1068: movl $10,%eax # case 't': jmp _1062 # return '\t'; _1069: cmpl $116,%eax jne _1071 _1070: movl $9,%eax # case 'b': jmp _1062 # return '\b'; _1071: cmpl $98,%eax jne _1073 _1072: movl $8,%eax # case 'r': jmp _1062 # return '\r'; _1073: cmpl $114,%eax jne _1075 _1074: movl $13,%eax # case 'f': jmp _1062 # return '\f'; _1075: cmpl $102,%eax jne _1077 _1076: movl $12,%eax # case '\n': jmp _1062 # return escape(); _1077: cmpl $10,%eax jne _1079 _1078: call escape # default: jmp _1062 # return c; _1080: movsbl -13(%ebp),%eax # } jmp _1062 # } _1079: jmp _1080 _1067: # if (c == '\n') error(EXERR); _1063: movl $10,%eax movsbl -13(%ebp),%edx subl %eax,%edx jne _1081 movl $4,%edx pushl %edx call error addl $4,%esp # getch(); _1081: call getch # return c; movsbl -13(%ebp),%eax # } _1062: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1082: .size escape,_1082-escape # # FILE * # getfname(void) # getfname # 0 # { .align 2 .globl getfname getfname: .type getfname,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int i; # char name[LBUFSIZE]; # FILE *fp; # # getch(); subl $4104,%esp call getch # if(skipspc()!='"') error(INCERR); movl $34,%eax xchg %ecx,%eax call skipspc subl %ecx,%eax je _1084 movl $13,%eax pushl %eax call error addl $4,%esp # for(i=0;(getch()!='"' && ch!='\n');) { _1084: movl $0,%eax movl %eax,-16(%ebp) _1086: movl $34,%eax xchg %ecx,%eax call getch subl %ecx,%eax je _1085 movl $10,%eax movl ch,%ecx subl %eax,%ecx je _1085 # if(i<LBUFSIZE-1) name[i++]=ch; movl $4095,%ecx movl -16(%ebp),%eax subl %ecx,%eax jge _1087 movl ch,%eax lea -16(%ebp),%ecx movl (%ecx),%edx addl $1,(%ecx) lea -4112(%ebp),%ecx addl %edx,%ecx movb %eax,(%ecx) movl %eax,%ecx # } _1087: # if(ch=='\n') error(INCERR); jmp _1086 _1085: movl $10,%ecx movl ch,%eax subl %ecx,%eax jne _1088 movl $13,%eax pushl %eax call error addl $4,%esp # name[i]=0; _1088: movl $0,%eax movl -16(%ebp),%ecx lea -4112(%ebp),%edx addl %ecx,%edx movb %eax,(%edx) movl %eax,%edx # fp = fopen(name,"r") ; .section .rodata _1089: .string "r" .text lea _1089,%edx pushl %edx lea -4112(%ebp),%edx pushl %edx call fopen addl $8,%esp movl %eax,-4116(%ebp) # return ( (filep+1)->fcb = fp ); movl -4116(%ebp),%eax movl $8,%edx movl $12,%ecx pushl %ecx movl filep,%ecx popl %ebx addl %ebx,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # } movl %ecx,%eax _1083: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1090: .size getfname,_1090-getfname # # void # getline(void) # getline # 714 # { .align 2 .globl getline getline: .type getline,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int i; # int c; # # lineno++; subl $8,%esp movl $lineno,%eax movl (%eax),%ecx addl $1,(%eax) # glineno++; movl $glineno,%ecx movl (%ecx),%eax addl $1,(%ecx) # chptr=linebuf; movl $linebuf,%eax movl %eax,chptr # i=0; movl $0,%eax movl %eax,-16(%ebp) # /* while ((*chptr++ = c = getc(filep->fcb)) != '\n') { # we cannot handle unsaved register in library call # so make it easy for the compiler # */ # while ((c=getc(filep->fcb)),(*chptr++=c)!='\n') { _1093: movl $8,%eax movl filep,%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx call getc addl $4,%esp movl %eax,-20(%ebp) movl $10,%eax movl -20(%ebp),%ecx movl $chptr,%edx pushl %edx popl %ebx movl (%ebx),%edx addl $1,(%ebx) movb %ecx,(%edx) movl %ecx,%edx subl %eax,%edx jne _1094 xorl %edx,%edx jmp _1095 _1094: movl $1,%edx _1095: cmpl $0,%edx je _1092 # if (++i > LBUFSIZE-2) error(LNERR); movl $4094,%edx lea -16(%ebp),%ecx addl $1,(%ecx) movl (%ecx),%ecx subl %edx,%ecx jle _1096 movl $10,%ecx pushl %ecx call error addl $4,%esp # if (c==EOF) { _1096: movl $-1,%eax movl -20(%ebp),%ecx subl %eax,%ecx jne _1097 # error(EOFERR); movl $11,%ecx pushl %ecx call error addl $4,%esp # --chptr; movl $chptr,%eax addl $-1,(%eax) movl (%eax),%eax # } # } _1097: # *chptr = '\0'; jmp _1093 _1092: movl $0,%eax movl chptr,%ecx movb %eax,(%ecx) movl %eax,%ecx # if (lsrc && !asmf) gen_comment(linebuf); cmpl $0,lsrc je _1098 cmpl $0,asmf jne _1098 movl $linebuf,%ecx pushl %ecx call gen_comment addl $4,%esp # if (*(chptr = linebuf) == '#') { _1098: movl $35,%eax movl $linebuf,%ecx movl %ecx,chptr movsbl (%ecx),%ecx subl %eax,%ecx jne _1099 # ++chptr; movl $chptr,%ecx addl $1,(%ecx) movl (%ecx),%ecx # if (macroeq("define")) { .section .rodata _1101: .string "define" .text lea _1101,%ecx pushl %ecx call macroeq addl $4,%esp cmpl $0,%eax je _1100 # i=mode; movl mode,%eax movl %eax,-16(%ebp) # mode=GDECL; movl $1,%eax movl %eax,mode # ch= *chptr; movl chptr,%eax movsbl (%eax),%eax movl %eax,ch # if (getsym() == IDENT) { movl $-26,%eax xchg %ecx,%eax call getsym subl %ecx,%eax jne _1102 # if (nptr->sc == EMPTY) { movl $-9,%eax movl $4,%ecx movl nptr,%edx addl %ecx,%edx movl (%edx),%edx subl %eax,%edx jne _1103 # nptr->sc = MACRO; movl $-28,%edx movl $4,%eax movl nptr,%ecx addl %eax,%ecx movl %edx,(%ecx) movl %edx,%ecx # nptr->dsp = (int)cheapp; movl cheapp,%ecx movl $12,%eax movl nptr,%edx addl %eax,%edx movl %ecx,(%edx) movl %ecx,%edx # while ((*cheapp++ = c = *chptr++) _1105: # && c != '\n'); movl $chptr,%edx movl (%edx),%eax addl $1,(%edx) movsbl (%eax),%eax movl %eax,-20(%ebp) movl $cheapp,%ecx movl (%ecx),%edx addl $1,(%ecx) movb %eax,(%edx) movl %eax,%edx cmpl $0,%edx je _1106 movl $10,%edx movl -20(%ebp),%eax subl %edx,%eax jne _1105 _1106: # *cheapp++ = '\0'; _1104: movl $0,%eax movl $cheapp,%ecx movl (%ecx),%edx addl $1,(%ecx) movb %eax,(%edx) movl %eax,%edx # if (cheapp >= cheap+CHEAPSIZE) movl $256000,%edx movl $cheap,%eax addl %edx,%eax movl cheapp,%ecx subl %eax,%ecx jb _1107 # error(STRERR); movl $9,%ecx pushl %ecx call error addl $4,%esp # if (!c) error(EOFERR); _1107: cmpl $0,-20(%ebp) jne _1108 movl $11,%eax pushl %eax call error addl $4,%esp # } else error(MCERR); _1108: jmp _1109 _1103: movl $12,%eax pushl %eax call error addl $4,%esp # } else error(MCERR); _1109: jmp _1110 _1102: movl $12,%eax pushl %eax call error addl $4,%esp # mode=i; _1110: movl -16(%ebp),%eax movl %eax,mode # *(chptr = linebuf) = '\0'; movl $0,%eax movl $linebuf,%ecx movl %ecx,chptr movb %eax,(%ecx) movl %eax,%ecx # } else if (macroeq("include")) { jmp _1111 _1100: .section .rodata _1113: .string "include" .text lea _1113,%ecx pushl %ecx call macroeq addl $4,%esp cmpl $0,%eax je _1112 # if(filep+1 >= filestack + FILES) error(FILERR); movl $36,%eax movl $filestack,%ecx addl %eax,%ecx movl $12,%eax movl filep,%edx addl %eax,%edx subl %ecx,%edx jb _1114 movl $1,%edx pushl %edx call error addl $4,%esp # if ( ((filep+1)->fcb=getfname()) == NULL) error(FILERR); _1114: movl $0,%eax xchg %edx,%eax call getfname movl $8,%ecx pushl %ecx movl $12,%ecx pushl %ecx movl filep,%ecx popl %ebx addl %ebx,%ecx popl %ebx addl %ebx,%ecx movl %eax,(%ecx) movl %eax,%ecx subl %edx,%ecx jne _1115 movl $1,%ecx pushl %ecx call error addl $4,%esp # (filep+1)->ln=lineno; _1115: movl lineno,%eax movl $4,%ecx movl $12,%edx pushl %edx movl filep,%edx popl %ebx addl %ebx,%edx addl %ecx,%edx movl %eax,(%edx) movl %eax,%edx # lineno=0; movl $0,%edx movl %edx,lineno # ++filep; movl $filep,%edx addl $12,(%edx) movl (%edx),%edx # *(chptr = linebuf) = '\0'; movl $0,%edx movl $linebuf,%ecx movl %ecx,chptr movb %edx,(%ecx) movl %edx,%ecx # } else if (macroeq("asm")) { jmp _1116 _1112: .section .rodata _1118: .string "asm" .text lea _1118,%ecx pushl %ecx call macroeq addl $4,%esp cmpl $0,%eax je _1117 # if (asmf) error(MCERR); cmpl $0,asmf je _1119 movl $12,%eax pushl %eax call error addl $4,%esp # asmf = 1; _1119: movl $1,%eax movl %eax,asmf # getline(); call getline # while (asmf) { _1121: cmpl $0,asmf je _1120 # gen_source(linebuf); movl $linebuf,%eax pushl %eax call gen_source addl $4,%esp # getline(); call getline # } # } else if (macroeq("endasm")) { jmp _1121 _1120: jmp _1122 _1117: .section .rodata _1124: .string "endasm" .text lea _1124,%eax pushl %eax call macroeq addl $4,%esp cmpl $0,%eax je _1123 # if (!asmf) error(MCERR); cmpl $0,asmf jne _1125 movl $12,%eax pushl %eax call error addl $4,%esp # asmf = 0; _1125: movl $0,%eax movl %eax,asmf # } else if (macroeq(" ")) jmp _1126 _1123: .section .rodata _1128: .string " " .text lea _1128,%eax pushl %eax call macroeq addl $4,%esp cmpl $0,%eax je _1127 # getline(); call getline # else error(MCERR); jmp _1129 _1127: movl $12,%eax pushl %eax call error addl $4,%esp # } _1129: _1126: _1122: _1116: _1111: # } _1099: _1091: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1130: .size getline,_1130-getline # # int # macroeq(char *s) # macroeq # 769 # { .align 2 .globl macroeq macroeq: .type macroeq,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # char *p; # # for (p = chptr; *s;) if (*s++ != *p++) return 0; subl $4,%esp movl chptr,%eax movl %eax,-16(%ebp) _1133: movl 8(%ebp),%eax movsbl (%eax),%eax cmpl $0,%eax je _1132 lea -16(%ebp),%eax movl (%eax),%ecx addl $1,(%eax) movsbl (%ecx),%ecx lea 8(%ebp),%eax movl (%eax),%edx addl $1,(%eax) movsbl (%edx),%edx subl %ecx,%edx je _1134 movl $0,%edx # chptr = p; movl %edx,%eax jmp _1131 _1134: jmp _1133 _1132: movl -16(%ebp),%eax movl %eax,chptr # return 1; movl $1,%eax # } _1131: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1135: .size macroeq,_1135-macroeq # # int # car(int e) # car # 509 # { .align 2 .globl car car: .type car,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return heap[e]; movl $4,%eax movl 8(%ebp),%ecx imull %eax,%ecx movl $heap,%eax addl %ecx,%eax movl (%eax),%eax # } _1136: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1137: .size car,_1137-car # # int # cadr(int e) # cadr # 504 # { .align 2 .globl cadr cadr: .type cadr,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return heap[e+1]; movl $4,%eax movl $1,%ecx movl 8(%ebp),%edx addl %ecx,%edx imull %eax,%edx movl $heap,%eax addl %edx,%eax movl (%eax),%eax # } _1138: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1139: .size cadr,_1139-cadr # # int # caddr(int e) # caddr # 499 # { .align 2 .globl caddr caddr: .type caddr,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return heap[e+2]; movl $4,%eax movl $2,%ecx movl 8(%ebp),%edx addl %ecx,%edx imull %eax,%edx movl $heap,%eax addl %edx,%eax movl (%eax),%eax # } _1140: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1141: .size caddr,_1141-caddr # # int # cadddr(int e) # cadddr # 0 # { .align 2 .globl cadddr cadddr: .type cadddr,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # return heap[e+3]; movl $4,%eax movl $3,%ecx movl 8(%ebp),%edx addl %ecx,%edx imull %eax,%edx movl $heap,%eax addl %edx,%eax movl (%eax),%eax # } _1142: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1143: .size cadddr,_1143-cadddr # # int # list2(int e1, int e2) # list2 # 749 # 749 # { .align 2 .globl list2 list2: .type list2,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # e=getfree(2); subl $4,%esp movl $2,%eax pushl %eax call getfree addl $4,%esp movl %eax,-16(%ebp) # heap[e]=e1; movl 8(%ebp),%eax movl $4,%ecx movl -16(%ebp),%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # heap[e+1]=e2; movl 12(%ebp),%ecx movl $4,%eax movl $1,%edx pushl %edx movl -16(%ebp),%edx popl %ebx addl %ebx,%edx imull %eax,%edx movl $heap,%eax addl %edx,%eax movl %ecx,(%eax) movl %ecx,%eax # return e; movl -16(%ebp),%eax # } _1144: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1145: .size list2,_1145-list2 # # int # list3(int e1, int e2, int e3) # list3 # 754 # 754 # 754 # { .align 2 .globl list3 list3: .type list3,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # e=getfree(3); subl $4,%esp movl $3,%eax pushl %eax call getfree addl $4,%esp movl %eax,-16(%ebp) # heap[e]=e1; movl 8(%ebp),%eax movl $4,%ecx movl -16(%ebp),%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # heap[e+1]=e2; movl 12(%ebp),%ecx movl $4,%eax movl $1,%edx pushl %edx movl -16(%ebp),%edx popl %ebx addl %ebx,%edx imull %eax,%edx movl $heap,%eax addl %edx,%eax movl %ecx,(%eax) movl %ecx,%eax # heap[e+2]=e3; movl 16(%ebp),%eax movl $4,%ecx movl $2,%edx pushl %edx movl -16(%ebp),%edx popl %ebx addl %ebx,%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # return e; movl -16(%ebp),%ecx # } movl %ecx,%eax _1146: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1147: .size list3,_1147-list3 # # int # list4(int e1, int e2, int e3, int e4) # list4 # 759 # 759 # 759 # 759 # { .align 2 .globl list4 list4: .type list4,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # e=getfree(4); subl $4,%esp movl $4,%eax pushl %eax call getfree addl $4,%esp movl %eax,-16(%ebp) # heap[e]=e1; movl 8(%ebp),%eax movl $4,%ecx movl -16(%ebp),%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # heap[e+1]=e2; movl 12(%ebp),%ecx movl $4,%eax movl $1,%edx pushl %edx movl -16(%ebp),%edx popl %ebx addl %ebx,%edx imull %eax,%edx movl $heap,%eax addl %edx,%eax movl %ecx,(%eax) movl %ecx,%eax # heap[e+2]=e3; movl 16(%ebp),%eax movl $4,%ecx movl $2,%edx pushl %edx movl -16(%ebp),%edx popl %ebx addl %ebx,%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # heap[e+3]=e4; movl 20(%ebp),%ecx movl $4,%eax movl $3,%edx pushl %edx movl -16(%ebp),%edx popl %ebx addl %ebx,%edx imull %eax,%edx movl $heap,%eax addl %edx,%eax movl %ecx,(%eax) movl %ecx,%eax # return e; movl -16(%ebp),%eax # } _1148: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1149: .size list4,_1149-list4 # # int # getfree(int n) # getfree # 709 # { .align 2 .globl getfree getfree: .type getfree,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # int e; # # switch (mode) { subl $4,%esp movl mode,%eax # case GDECL: case GSDECL: case GUDECL: case GTDECL: # e=gfree; cmpl $10,%eax je _1152 cmpl $3,%eax je _1152 cmpl $2,%eax je _1152 cmpl $1,%eax jne _1153 _1152: movl gfree,%eax movl %eax,-16(%ebp) # gfree+=n; movl 8(%ebp),%eax movl $gfree,%ecx pushl %ecx # assop movl (%ecx),%ecx addl %eax,%ecx popl %ebx # assop movl %ecx,(%ebx) # break; jmp _1151 # default: # lfree-=n; _1154: movl 8(%ebp),%ecx movl $lfree,%eax pushl %eax # assop movl (%eax),%eax subl %ecx,%eax popl %ebx # assop movl %eax,(%ebx) # e=lfree; movl lfree,%eax movl %eax,-16(%ebp) # } # if(lfree<gfree) error(HPERR); jmp _1155 _1153: jmp _1154 _1155: _1151: movl gfree,%eax movl lfree,%ecx subl %eax,%ecx jge _1156 movl $14,%ecx pushl %ecx call error addl $4,%esp # return e; _1156: movl -16(%ebp),%eax # } _1150: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1157: .size getfree,_1157-getfree # # int # rplacad(int e, int n) # rplacad # 809 # 809 # { .align 2 .globl rplacad rplacad: .type rplacad,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # heap[e+1]=n; movl 12(%ebp),%eax movl $4,%ecx movl $1,%edx pushl %edx movl 8(%ebp),%edx popl %ebx addl %ebx,%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # return e; movl 8(%ebp),%ecx # } movl %ecx,%eax _1158: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1159: .size rplacad,_1159-rplacad # # int # rplacadd(int e, int n) # rplacadd # 0 # 0 # { .align 2 .globl rplacadd rplacadd: .type rplacadd,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # heap[e+2]=n; movl 12(%ebp),%eax movl $4,%ecx movl $2,%edx pushl %edx movl 8(%ebp),%edx popl %ebx addl %ebx,%edx imull %ecx,%edx movl $heap,%ecx addl %edx,%ecx movl %eax,(%ecx) movl %eax,%ecx # return e; movl 8(%ebp),%ecx # } movl %ecx,%eax _1160: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1161: .size rplacadd,_1161-rplacadd # # display_ntable(NMTBL *n, char *s) # display_ntable # 0 # 0 # { .align 2 .globl display_ntable display_ntable: .type display_ntable,@function pushl %ebp movl %esp,%ebp pushl %ebx pushl %ecx pushl %edx # fprintf(stderr,"\n%s %0x %0x ",s,n,ntable); movl $ntable,%eax pushl %eax movl 8(%ebp),%eax pushl %eax movl 12(%ebp),%eax pushl %eax .section .rodata _1163: .string "\n%s %0x %0x " .text lea _1163,%eax pushl %eax movl $__sstderr,%eax pushl %eax call fprintf addl $20,%esp # fprintf(stderr,"nptr->sc %d ",n->sc); movl $4,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx .section .rodata _1164: .string "nptr->sc %d " .text lea _1164,%ecx pushl %ecx movl $__sstderr,%ecx pushl %ecx call fprintf addl $12,%esp # fprintf(stderr,"nptr->dsp %d ",n->dsp); movl $12,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx .section .rodata _1165: .string "nptr->dsp %d " .text lea _1165,%ecx pushl %ecx movl $__sstderr,%ecx pushl %ecx call fprintf addl $12,%esp # fprintf(stderr,"nptr->ty %d ",n->ty); movl $8,%eax movl 8(%ebp),%ecx addl %eax,%ecx movl (%ecx),%ecx pushl %ecx .section .rodata _1166: .string "nptr->ty %d " .text lea _1166,%ecx pushl %ecx movl $__sstderr,%ecx pushl %ecx call fprintf addl $12,%esp # fprintf(stderr,"nptr->nm %s\n",n->nm); movl 8(%ebp),%eax movl (%eax),%eax pushl %eax .section .rodata _1167: .string "nptr->nm %s\n" .text lea _1167,%eax pushl %eax movl $__sstderr,%eax pushl %eax call fprintf addl $12,%esp # } _1162: lea -12(%ebp),%esp popl %edx popl %ecx popl %ebx leave ret _1168: .size display_ntable,_1168-display_ntable # # /* end */ .comm glineno,4 .comm blabel,4 .comm retcont,4 .comm symval,4 .comm cslabel,4 .comm ntable,152000 .comm ac,4 .comm av,4 .comm ch,4 .comm fnptr,4 .comm ilabel,4 .comm gfree,4 .comm init_vars,4 .comm debug,4 .comm retpending,4 .comm filep,4 .comm __sstderr,96 .comm int_size,4 .comm __sstdout,96 .comm filestack,36 .comm clabel,4 .comm stmode,4 .comm mflag,4 .comm lfree,4 .comm labelno,4 .comm MAX_REGISTER_VAR,4 .comm dlabel,4 .comm null_nptr,16 .comm gpc,4 .comm chptrsave,4 .comm chptr,4 .comm lineno,4 .comm lsrc,4 .comm cheap,256000 .comm ac2,4 .comm csvalue,4 .comm chk,4 .comm chsave,4 .comm retlabel,4 .comm type,4 .comm __sstdin,96 .comm sptr,4 .comm arg_offset,4 .comm mode,4 .comm endian,4 .comm sym,4 .comm obuf,4 .comm code_arg_offset,4 .comm name,4 .comm control,4 .comm gnptr,4 .comm linebuf,4096 .comm stat_no,4 .comm namebuf,4096 .comm disp_offset,4 .comm nptr,4 .comm cheapp,4 .comm heap,40000 .comm hash,4 .comm reg_var,4 .comm asmf,4 .comm disp,4 .comm args,4 .comm csvalue1,4 .ident "Micro-C compiled"