Mercurial > hg > CbC > old > device
changeset 162:0c604d2ff585
*** empty log message ***
author | kono |
---|---|
date | Mon, 24 Nov 2003 00:21:59 +0900 |
parents | cc2fc5c0dfe5 |
children | fc8514c9d685 |
files | mc-code-powerpc.c mc-code.h mc-codegen.c mc-parse.c mc.h |
diffstat | 5 files changed, 244 insertions(+), 170 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-code-powerpc.c Sun Nov 23 22:40:26 2003 +0900 +++ b/mc-code-powerpc.c Mon Nov 24 00:21:59 2003 +0900 @@ -12,7 +12,7 @@ static void data_mode(char *name); static void init_ptr_cache(); -static void ld_indexx(int byte, int n, int xreg); +static void ld_indexx(int byte, int n, int xreg,int sign); static void local_table(void); static void shift(char *op, int reg); static int struct_push(int e4,int t,int arg); @@ -778,16 +778,17 @@ } void -code_crgvar(int e1,int creg){ +code_crgvar(int e1,int creg,int sign){ char *crn = register_name(creg); printf("\tlbz %s,0(%s)\n",crn, register_name(get_ptr_cache((NMTBL*)cadr(e1)))); - printf("\textsb %s,%s\n",crn,crn); + if (sign) + printf("\textsb %s,%s\n",crn,crn); regv[creg]=1; } void -code_srgvar(int e1,int creg){ +code_srgvar(int e1,int creg,int sign){ char *crn = register_name(creg); printf("\tlhz %s,0(%s)\n",crn, register_name(get_ptr_cache((NMTBL*)cadr(e1)))); @@ -815,20 +816,22 @@ void -code_crlvar(int e2,int reg) { +code_crlvar(int e2,int reg,int sign) { lvar_intro(e2); printf("\tlbz %s,",register_name(reg)); lvar(e2); - printf("\textsb %s,%s\n",register_name(reg),register_name(reg)); + if (sign) + printf("\textsb %s,%s\n",register_name(reg),register_name(reg)); regv[creg]=1; } void -code_srlvar(int e2,int reg) { +code_srlvar(int e2,int reg,int sign) { lvar_intro(e2); printf("\tlhz %s,",register_name(reg)); lvar(e2); - printf("\textsh %s,%s\n",register_name(reg),register_name(reg)); + if (sign) + printf("\textsh %s,%s\n",register_name(reg),register_name(reg)); regv[creg]=1; } @@ -929,12 +932,13 @@ void -code_cpostinc(int e1,int e2,int reg) { +code_cpostinc(int e1,int e2,int reg,int sign) { char *xrn,*crn,*nrn; int i,nreg,dreg; if (car(e2)==REGISTER) { printf("\tlbz %s,0(%s)\n",register_name(reg),register_name(cadr(e2))); - printf("\textsb %s,%s\n",register_name(reg),register_name(reg)); + if (sign) + printf("\textsb %s,%s\n",register_name(reg),register_name(reg)); printf("\taddi %s,%s,%d\n", register_name(cadr(e2)),register_name(cadr(e2)),caddr(e1)); regv[reg]=1; @@ -948,7 +952,8 @@ nrn = register_name(nreg); printf("\tlwz %s,0(%s)\n",xrn,crn); printf("\tlbz %s,0(%s)\n",nrn,xrn); - printf("\textsb %s,%s\n",nrn,nrn); + if (sign) + printf("\textsb %s,%s\n",nrn,nrn); printf("\taddi %s,%s,%d\n", xrn,xrn,caddr(e1)); printf("\tstw %s,0(%s)\n",xrn,crn); i=creg;creg=nreg;nreg=i; @@ -959,12 +964,13 @@ void -code_cpreinc(int e1,int e2,int reg) { +code_cpreinc(int e1,int e2,int reg,int sign) { char *xrn,*crn,*nrn; int i,nreg,dreg; if (car(e2)==REGISTER) { printf("\tlbzu %s,%d(%s)\n",register_name(reg),caddr(e1),register_name(cadr(e2))); - printf("\textsb %s,%s\n",register_name(reg),register_name(reg)); + if (sign) + printf("\textsb %s,%s\n",register_name(reg),register_name(reg)); regv[reg]=1; return; } @@ -977,7 +983,8 @@ printf("\tlwz %s,0(%s)\n",xrn,crn); printf("\tlbzu %s,%d(%s)\n",nrn,caddr(e1),xrn); printf("\tstw %s,0(%s)\n",xrn,crn); - printf("\textsb %s,%s\n",nrn,nrn); + if (sign) + printf("\textsb %s,%s\n",nrn,nrn); i=creg;creg=nreg;nreg=i; free_register(nreg); free_register(dreg); @@ -986,7 +993,7 @@ void -code_cpostdec(int e1,int e2,int reg) { +code_cpostdec(int e1,int e2,int reg,int sign) { char *xrn,*crn,*nrn; int i,nreg,dreg; if (car(e2)==REGISTER) { @@ -994,7 +1001,8 @@ xrn=register_name(cadr(e2)); printf("\tlbz %s,0(%s)\n",crn,xrn); printf("\taddi %s,%s,%d\n",xrn,xrn,caddr(e1)); - printf("\textsb %s,%s\n",crn,crn); + if (sign) + printf("\textsb %s,%s\n",crn,crn); regv[reg]=1; return; } @@ -1008,7 +1016,8 @@ printf("\tlbz %s,0(%s)\n",nrn,xrn); printf("\taddi %s,%s,%d\n",xrn,xrn,caddr(e1)); printf("\tstw %s,0(%s)\n",xrn,crn); - printf("\textsb %s,%s\n",nrn,nrn); + if (sign) + printf("\textsb %s,%s\n",nrn,nrn); i=creg;creg=nreg;nreg=i; free_register(nreg); free_register(dreg); @@ -1017,14 +1026,15 @@ void -code_cpredec(int e1,int e2,int reg) { +code_cpredec(int e1,int e2,int reg,int sign) { char *xrn,*crn,*nrn; int i,nreg,dreg; if (car(e2)==REGISTER) { crn=register_name(reg); xrn=register_name(cadr(e2)); printf("\tlbzu %s,%d(%s)\n",crn,caddr(e1),xrn); - printf("\textsb %s,%s\n",crn,crn); + if (sign) + printf("\textsb %s,%s\n",crn,crn); regv[reg]=1; return; } @@ -1037,7 +1047,8 @@ printf("\tlwz %s,0(%s)\n",xrn,crn); printf("\tlbzu %s,%d(%s)\n",nrn,caddr(e1),xrn); printf("\tstw %s,0(%s)\n",xrn,crn); - printf("\textsb %s,%s\n",nrn,nrn); + if (sign) + printf("\textsb %s,%s\n",nrn,nrn); i=creg;creg=nreg;nreg=i; free_register(nreg); free_register(dreg); @@ -1638,6 +1649,9 @@ printf("\tlbz %s,%d(%s)\n",crn,offset,crn); printf("\textsb %s,%s\n",crn,crn); return CHAR; + case CURINDIRECT: + printf("\tlbz %s,%d(%s)\n",crn,offset,crn); + return UCHAR; case RINDIRECT: printf("\tlwz %s,%d(%s)\n",crn,offset,crn); return INT; @@ -1705,7 +1719,7 @@ void -code_assop(int op,int byte) { +code_assop(int op,int byte,int sign) { char *xrn,*crn,*drn; int xreg; int edx = get_register(); if(!edx) error(-1); @@ -1713,7 +1727,7 @@ regv[xreg]=regs[xreg]=1; printf("# assop\n\tmr %s,%s\n",register_name(edx),register_name(creg)); regv[edx]=1; - ld_indexx(byte,0,edx); + ld_indexx(byte,0,edx,sign); tosop(op,xreg); crn = register_name(creg); drn = register_name(edx); @@ -1824,13 +1838,14 @@ } void -ld_indexx(int byte, int n, int xreg) +ld_indexx(int byte, int n, int xreg,int sign) { char *crn = register_name(creg); if (byte) { printf("\tlbz %s,%d(%s)\n",register_name(creg),n, register_name(xreg)); - printf("\textsb %s,%s\n",crn,crn); + if (sign) + printf("\textsb %s,%s\n",crn,crn); } else printf("\tlwz %s,%d(%s)\n",register_name(creg),n, register_name(xreg));
--- a/mc-code.h Sun Nov 23 22:40:26 2003 +0900 +++ b/mc-code.h Mon Nov 24 00:21:59 2003 +0900 @@ -38,11 +38,11 @@ extern void code_cmpdimm(int e, int csreg); extern void code_gvar(int e1,int reg); extern void code_rgvar(int e1,int reg); -extern void code_crgvar(int e1,int reg); +extern void code_crgvar(int e1,int reg,int sign); extern void code_lvar(int e2,int reg); extern void code_register(int e2,int reg); extern void code_rlvar(int e2,int reg); -extern void code_crlvar(int e2,int reg); +extern void code_crlvar(int e2,int reg,int sign); extern void code_fname(NMTBL *n,int reg); extern void code_const(int e2,int reg); extern void code_neg(int reg); @@ -50,10 +50,10 @@ extern void code_lnot(int reg); extern void code_preinc(int e1,int e2,int reg); extern void code_postinc(int e1,int e2,int reg); -extern void code_cpostinc(int e1,int e2,int reg); -extern void code_cpreinc(int e1,int e2,int reg); -extern void code_cpostdec(int e1,int e2,int reg); -extern void code_cpredec(int e1,int e2,int reg); +extern void code_cpostinc(int e1,int e2,int reg,int sign); +extern void code_cpreinc(int e1,int e2,int reg,int sign); +extern void code_cpostdec(int e1,int e2,int reg,int sign); +extern void code_cpredec(int e1,int e2,int reg,int sign); extern void code_return(int reg); extern void code_environment(int reg); extern void code_bool(int e1); @@ -80,7 +80,7 @@ extern void code_assign_register(int e2,int byte,int reg); extern void code_assign(int e2,int byte,int reg); extern void code_register_assop(int e2,int op,int byte); -extern void code_assop(int op,int byte); +extern void code_assop(int op,int byte,int sign); extern void tosop(int op,int oreg); extern void code_opening(char *filename); extern void code_closing();
--- a/mc-codegen.c Sun Nov 23 22:40:26 2003 +0900 +++ b/mc-codegen.c Mon Nov 24 00:21:59 2003 +0900 @@ -95,8 +95,12 @@ return INT; case CRGVAR: creg=use_int(creg); - code_crgvar(e1,creg); + code_crgvar(e1,creg,1); return CHAR; + case CURGVAR: + creg=use_int(creg); + code_crgvar(e1,creg,0); + return UCHAR; case LVAR: creg=use_int(creg); code_lvar(e2,creg); @@ -119,8 +123,12 @@ return INT; case CRLVAR: creg=use_int(creg); - code_crlvar(e2,creg); + code_crlvar(e2,creg,1); return CHAR; + case CURLVAR: + creg=use_int(creg); + code_crlvar(e2,creg,0); + return UCHAR; case FRLVAR: creg=use_float(creg); code_drlvar(e2,0,creg); @@ -165,7 +173,7 @@ return VOID; case INDIRECT: return g_expr0(e2); - case RINDIRECT: case CRINDIRECT: + case RINDIRECT: case CRINDIRECT: case CURINDIRECT: case DRINDIRECT: case FRINDIRECT: return rindirect(e1); case ADDRESS: @@ -231,20 +239,36 @@ case CPOSTINC: /* char *p; *p++ */ creg=use_int(creg); - code_cpostinc(e1,e2,creg); + code_cpostinc(e1,e2,creg,1); return CHAR; case CPREINC: creg=use_int(creg); - code_cpreinc(e1,e2,creg); + code_cpreinc(e1,e2,creg,1); return CHAR; case CPOSTDEC: creg=use_int(creg); - code_cpostdec(e1,e2,creg); + code_cpostdec(e1,e2,creg,1); return CHAR; case CPREDEC: creg=use_int(creg); - code_cpredec(e1,e2,creg); + code_cpredec(e1,e2,creg,1); return CHAR; + case CUPOSTINC: + creg=use_int(creg); + code_cpostinc(e1,e2,creg,0); + return UCHAR; + case CUPREINC: + creg=use_int(creg); + code_cpreinc(e1,e2,creg,0); + return UCHAR; + case CUPOSTDEC: + creg=use_int(creg); + code_cpostdec(e1,e2,creg,0); + return UCHAR; + case CUPREDEC: + creg=use_int(creg); + code_cpredec(e1,e2,creg,0); + return UCHAR; case MUL: case UMUL: case DIV: case UDIV: case MOD: case UMOD: @@ -290,7 +314,7 @@ case FASS: case DASS: case LASS: dassign(e1); return DOUBLE; - case ASSOP: case CASSOP: + case ASSOP: case CASSOP: case CUASSOP: assop(e1); return INT; case DASSOP: case FASSOP: @@ -988,9 +1012,11 @@ if (car(e2)!=REGISTER) error(-1); reg = cadr(e2); switch(e5) { - case CRGVAR: code_crgvar(e4,reg); return; + case CRGVAR: + case CURGVAR: code_crgvar(e4,reg,e5==CRGVAR); return; case RGVAR: code_rgvar(e4,reg); return; - case CRLVAR: code_crlvar(cadr(e4),reg); return; + case CRLVAR: + case CURLVAR: code_crlvar(cadr(e4),reg,e5==CRLVAR); return; case RLVAR: code_rlvar(cadr(e4),reg); return; case GVAR: code_gvar(e4,reg); return; case LVAR: code_lvar(cadr(e4),reg); return; @@ -1018,6 +1044,7 @@ (e5==REGISTER) || (car(e2)==REGISTER&&( e5== CRGVAR || e5== CRLVAR || e5== RGVAR || e5== RLVAR || + e5== CURGVAR || e5== CURLVAR || e5== GVAR || e5== LVAR || e5== CONST || e5== FNAME || e5== STRING || (e5==ADDRESS&&car(cadr(e4))==STRING) || @@ -1139,10 +1166,16 @@ void assop(int e1) { - int e2,e3,byte,op; + int e2,e3,byte,op,sign; /* e2 op= e3 */ - byte = (car(e1) == CASSOP); + if (car(e1) == CUASSOP) { + byte = 1; sign = 0; + } else if (car(e1) == CASSOP) { + byte = 1; sign = 1; + } else { + byte = 0; sign = 1; + } e2 = cadr(e1); if (car(e2)==INDIRECT) e2=cadr(e2); e3 = caddr(e1); @@ -1156,7 +1189,7 @@ } emit_push(); g_expr(e2); - code_assop(op,byte); + code_assop(op,byte,sign); return; } @@ -1286,12 +1319,14 @@ case FUNCTION: case CODE: return contains_in_list(caddr(e),type); /* unary operators */ - case INDIRECT: case RINDIRECT: case CRINDIRECT: + case INDIRECT: case RINDIRECT: case CRINDIRECT: case CURINDIRECT: case DRINDIRECT: case FRINDIRECT: case ADDRESS: case MINUS: case DMINUS: case BNOT: case LNOT: case PREINC: case POSTINC: case DPREINC: case DPOSTINC: case FPREINC: case FPOSTINC: case CPOSTINC: case CPREINC: case CPOSTDEC: case CPREDEC: + case CUPOSTINC: + case CUPREINC: case CUPOSTDEC: case CUPREDEC: case RSTRUCT: /* case I2D: case D2I: case U2D: case D2U: */ case CONV: @@ -1323,9 +1358,9 @@ e = cadddr(e); continue; /* nullary operators */ - case GVAR: case RGVAR: case CRGVAR: case LVAR: + case GVAR: case RGVAR: case CRGVAR: case LVAR: case CURGVAR: case REGISTER: case DREGISTER: case FREGISTER: - case RLVAR: case CRLVAR: case FRLVAR: case FRGVAR: + case RLVAR: case CRLVAR: case CURLVAR: case FRLVAR: case FRGVAR: case DRLVAR: case DRGVAR: case FNAME: case CONST: case DCONST: case FCONST: case STRING: case RETURN: case ENVIRONMENT:
--- a/mc-parse.c Sun Nov 23 22:40:26 2003 +0900 +++ b/mc-parse.c Mon Nov 24 00:21:59 2003 +0900 @@ -474,7 +474,7 @@ case UNSIGNED: t = UNSIGNED; if(getsym()==INT) getsym(); - else if (sym==CHAR) { getsym(); t = sym; } + else if (sym==CHAR) { getsym(); t = UCHAR; } else if (sym==SHORT) { getsym(); t = sym; } else if (sym==LONGLONG) {getsym(); t = sym; } break; @@ -2476,6 +2476,18 @@ default:return(e); } } + if(type==UCHAR) { + type= UNSIGNED; + switch(car(e)) { + case GVAR: + return(list2(CURGVAR,cadr(e))); + case LVAR: + return(list2(CURLVAR,cadr(e))); + case INDIRECT: + return(list2(CURINDIRECT,cadr(e))); + default:return(e); + } + } if(type==FLOAT) { switch(car(e)) { case GVAR:
--- a/mc.h Sun Nov 23 22:40:26 2003 +0900 +++ b/mc.h Mon Nov 24 00:21:59 2003 +0900 @@ -12,13 +12,14 @@ #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 UNSIGNED (-2) +#define CHAR (-3) +#define UCHAR (-4) +#define POINTER (-5) +#define ARRAY (-6) +#define STRUCT (-7) +#define UNION (-8) +#define FUNCTION (-9) #define STATIC (-10) #define GOTO (-11) @@ -45,24 +46,27 @@ #define SIZEOF (-32) #define TYPE (-33) #define LONG (-34) -#define SHORT (-35) -#define EXTRN (-36) -#define EXTRN1 (-37) -#define VOID (-38) -#define REGISTER (-39) -#define CODE (-40) -#define ENVIRONMENT (-41) -#define DEFINED (-42) -#define KONST (-43) -#define FMACRO (-44) -#define LMACRO (-45) -#define DOTS (-46) +#define ULONG (-35) +#define SHORT (-36) +#define USHORT (-37) +#define EXTRN (-38) +#define EXTRN1 (-39) +#define VOID (-40) +#define REGISTER (-41) +#define CODE (-42) +#define ENVIRONMENT (-43) +#define DEFINED (-44) +#define KONST (-45) +#define FMACRO (-46) +#define LMACRO (-47) +#define DOTS (-49) -#define FLOAT (-47) -#define DOUBLE (-48) -#define LONGLONG (-49) -#define FREGISTER (-50) -#define DREGISTER (-51) +#define FLOAT (-50) +#define DOUBLE (-51) +#define FREGISTER (-52) +#define DREGISTER (-53) +#define LONGLONG (-54) +#define ULONGLONG (-55) #define EMPTY (-99) @@ -84,73 +88,81 @@ #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 CMP 32 -#define RSHIFT 33 -#define URSHIFT 34 -#define LSHIFT 35 -#define ULSHIFT 36 -#define GT 37 -#define UGT 38 -#define GE 39 -#define UGE 40 -#define LT 41 -#define ULT 42 -#define LE 43 -#define ULE 44 -#define EQ 45 -#define NEQ 46 -#define BAND 47 -#define EOR 48 -#define BOR 49 -#define LAND 50 -#define LOR 51 -#define COND 52 -#define ASS 53 -#define CASS 54 -#define ASSOP 55 -#define CASSOP 56 -#define COMMA 57 -#define LPAR 58 -#define RPAR 59 -#define LBRA 60 -#define RBRA 61 -#define LC 62 -#define RC 63 -#define COLON 64 -#define SM 65 -#define PERIOD 66 -#define ARROW 67 -#define CNAME 68 -#define SASS 69 -#define RSTRUCT 70 +#define CURGVAR 4 +#define LVAR 5 +#define RLVAR 6 +#define CRLVAR 7 +#define CURLVAR 8 +#define CONST 9 +#define FNAME 10 +#define INDIRECT 11 +#define RINDIRECT 12 +#define CRINDIRECT 13 +#define CURINDIRECT 14 +#define ADDRESS 15 +#define MINUS 16 +#define LNOT 17 +#define BNOT 18 +#define INC 19 +#define POSTINC 20 +#define PREINC 21 +#define CPOSTINC 22 +#define CPREINC 23 +#define CUPOSTINC 24 +#define CUPREINC 25 +#define DEC 26 +#define CPOSTDEC 27 +#define CPREDEC 28 +#define CUPOSTDEC 29 +#define CUPREDEC 30 +#define MUL 31 +#define UMUL 32 +#define DIV 33 +#define UDIV 34 +#define MOD 35 +#define UMOD 36 +#define ADD 37 +#define SUB 38 +#define CMP 39 +#define RSHIFT 40 +#define URSHIFT 41 +#define LSHIFT 42 +#define ULSHIFT 43 +#define GT 44 +#define UGT 45 +#define GE 46 +#define UGE 47 +#define LT 48 +#define ULT 49 +#define LE 50 +#define ULE 51 +#define EQ 52 +#define NEQ 53 +#define BAND 54 +#define EOR 55 +#define BOR 56 +#define LAND 57 +#define LOR 58 +#define COND 59 +#define ASS 60 +#define CASS 61 +#define ASSOP 62 +#define CASSOP 63 +#define CUASSOP 64 +#define COMMA 65 +#define LPAR 66 +#define RPAR 67 +#define LBRA 68 +#define RBRA 69 +#define LC 70 +#define RC 71 +#define COLON 72 +#define SM 73 +#define PERIOD 74 +#define ARROW 75 +#define CNAME 76 +#define SASS 77 +#define RSTRUCT 78 #define DASSOP (DOP+ASSOP) #define DCMP (DOP+CMP) @@ -166,48 +178,48 @@ #define FDIV (FOP+DIV) #define FADD (FOP+ADD) #define FSUB (FOP+SUB) -#define CMPGE 72 +#define CMPGE 79 #define DCMPGE (DOP+CMPGE) #define FCMPGE (FOP+CMPGE) -#define LMUL 73 -#define LDIV 74 -#define LADD 75 -#define LSUB 76 +#define LMUL 80 +#define LDIV 81 +#define LADD 82 +#define LSUB 83 -#define FRGVAR 82 -#define FRLVAR 83 -#define FRINDIRECT 84 -#define DRGVAR 85 -#define DRLVAR 86 -#define DRINDIRECT 87 -#define LRGVAR 88 -#define LRLVAR 89 -#define LRINDIRECT 90 +#define FRGVAR 84 +#define FRLVAR 85 +#define FRINDIRECT 86 +#define DRGVAR 87 +#define DRLVAR 88 +#define DRINDIRECT 90 +#define LRGVAR 91 +#define LRLVAR 92 +#define LRINDIRECT 93 #define DCONST (DOP+CONST) #define FCONST (FOP+CONST) -#define LCONST 93 -#define DASS 94 -#define FASS 95 -#define LASS 96 -#define SHASS 97 +#define LCONST 94 +#define DASS 95 +#define FASS 96 +#define LASS 97 +#define SHASS 98 -#define I2D 98 -#define D2I 99 -#define U2D 100 -#define D2U 101 -#define F2D 108 -#define D2F 109 -#define I2F 110 -#define F2I 111 -#define U2F 112 -#define F2U 113 +#define I2D 99 +#define D2I 100 +#define U2D 101 +#define D2U 102 +#define F2D 103 +#define D2F 104 +#define I2F 105 +#define F2I 106 +#define U2F 107 +#define F2U 108 #define FPOSTINC (FOP+POSTINC) #define DPOSTINC (DOP+POSTINC) #define FPREINC (FOP+PREINC) #define DPREINC (DOP+PREINC) #define DCOND (DOP+COND) #define FCOND (FOP+COND) -#define CONV 107 +#define CONV 109 #define US 1 #define AS 200 @@ -240,7 +252,7 @@ #define LSYMS 500 #define MSYMS 3000 -#define HEAPSIZE 10000 +#define HEAPSIZE 20000 /* #define CHEAPSIZE 3000 */ #define CHEAPSIZE 256000 #define LBUFSIZE 4096