From: johanknol Date: Thu, 15 Nov 2001 14:14:24 +0000 (+0000) Subject: fixed undefined _ESP in main.c X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=94e8ba7712cf282de18bd0c9e2213501fa189c79;p=fw%2Fsdcc fixed undefined _ESP in main.c fixed genPcall() for screwing dptr optimized genCall for dptr use fixed/extended funptr.s git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1595 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/gen.c b/src/ds390/gen.c index af8ec011..a7bf72ea 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -2256,6 +2256,7 @@ genCall (iCode * ic) { int size, offset = 0; +#if 0 aopOp (IC_LEFT (sic), sic, FALSE, FALSE); size = AOP_SIZE (IC_LEFT (sic)); @@ -2291,6 +2292,29 @@ genCall (iCode * ic) fReturn[size], regs390[size].name); } } +#else + // we know that dpl(hxb) is the result, so + _startLazyDPSEvaluation (); + size=getSize(operandType(IC_LEFT(sic))); + if (size>1) { + aopOp (IC_LEFT (sic), sic, FALSE, TRUE); + } else { + aopOp (IC_LEFT (sic), sic, FALSE, FALSE); + } + while (size--) + { + char *l = aopGet (AOP (IC_LEFT (sic)), offset, + FALSE, FALSE, TRUE); + if (strcmp (l, fReturn[offset])) + { + emitcode ("mov", "%s,%s", + fReturn[offset], + l); + } + offset++; + } + _endLazyDPSEvaluation (); +#endif freeAsmop (IC_LEFT (sic), NULL, sic, TRUE); } _G.sendSet = NULL; @@ -2443,9 +2467,14 @@ genPcall (iCode * ic) { int size, offset = 0; - aopOp (IC_LEFT (sic), sic, FALSE, FALSE); - size = AOP_SIZE (IC_LEFT (sic)); + // we know that dpl(hxb) is the result, so _startLazyDPSEvaluation (); + size=getSize(operandType(IC_LEFT(sic))); + if (size>1) { + aopOp (IC_LEFT (sic), sic, FALSE, TRUE); + } else { + aopOp (IC_LEFT (sic), sic, FALSE, FALSE); + } while (size--) { char *l = aopGet (AOP (IC_LEFT (sic)), offset, diff --git a/src/ds390/main.c b/src/ds390/main.c index f343ebaf..0cefd4b7 100644 --- a/src/ds390/main.c +++ b/src/ds390/main.c @@ -169,6 +169,7 @@ _ds390_genAssemblerPreamble (FILE * of) fputs ("mb = 0xD4\t\t; mb register unknown to assembler\n", of); fputs ("mc = 0xD5\t\t; mc register unknown to assembler\n", of); fputs ("F1 = 0xD1\t\t; F1 user flag unknown to assembler\n", of); + fputs ("_ESP = 0x9B\t\t; ESP user flag unknown to assembler\n", of); } /* Generate interrupt vector table. */ @@ -205,11 +206,11 @@ _ds390_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) static bool cseCostEstimation (iCode *ic, iCode *pdic) { operand *result = IC_RESULT(ic); - operand *right = IC_RIGHT(ic); - operand *left = IC_LEFT(ic); + //operand *right = IC_RIGHT(ic); + //operand *left = IC_LEFT(ic); sym_link *result_type = operandType(result); - sym_link *right_type = (right ? operandType(right) : 0); - sym_link *left_type = (left ? operandType(left) : 0); + //sym_link *right_type = (right ? operandType(right) : 0); + //sym_link *left_type = (left ? operandType(left) : 0); /* if it is a pointer then return ok for now */ if (IC_RESULT(ic) && IS_PTR(result_type)) return 1; diff --git a/support/regression/ports/ds390/spec.mk b/support/regression/ports/ds390/spec.mk index ff6a68e3..26d30800 100644 --- a/support/regression/ports/ds390/spec.mk +++ b/support/regression/ports/ds390/spec.mk @@ -19,10 +19,10 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT) %$(OBJEXT): %.c $(SDCC) $(SDCCFLAGS) -c $< -# run simulator with 5 seconds timeout +# run simulator with 10 seconds timeout %.out: %$(EXEEXT) fwk/lib/timeout mkdir -p `dirname $@` - -fwk/lib/timeout 5 $(S51) -tds390f -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/ds390/uCsim.cmd >/dev/null || \ + -fwk/lib/timeout 10 $(S51) -tds390f -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/ds390/uCsim.cmd >/dev/null || \ echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@ -grep -n FAIL $@ /dev/null || true diff --git a/support/regression/ports/mcs51/spec.mk b/support/regression/ports/mcs51/spec.mk index 91eb9461..560f14eb 100644 --- a/support/regression/ports/mcs51/spec.mk +++ b/support/regression/ports/mcs51/spec.mk @@ -21,10 +21,10 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT) %$(OBJEXT): %.c $(SDCC) $(SDCCFLAGS) -c $< -# run simulator with 5 seconds timeout +# run simulator with 10 seconds timeout %.out: %$(EXEEXT) fwk/lib/timeout mkdir -p `dirname $@` - -fwk/lib/timeout 6 $(S51) -t32 -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/mcs51/uCsim.cmd >/dev/null \ + -fwk/lib/timeout 10 $(S51) -t32 -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/mcs51/uCsim.cmd >/dev/null \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@ -grep -n FAIL $@ /dev/null || true diff --git a/support/regression/tests/funptrs.c b/support/regression/tests/funptrs.c index 3e584cf5..1e2e7e1e 100644 --- a/support/regression/tests/funptrs.c +++ b/support/regression/tests/funptrs.c @@ -1,4 +1,6 @@ /** Function pointer tests. + + type: char, int, long */ #include @@ -6,7 +8,7 @@ on the z80. */ typedef void (*NOARGFUNPTR)(void); -typedef void (*ONEARGFUNPTR)(int) REENTRANT; +typedef void (*ONEARGFUNPTR)({type}) REENTRANT; int count; @@ -17,7 +19,7 @@ incCount(void) } void -incBy(int a) REENTRANT +incBy({type} a) REENTRANT { count += a; } @@ -29,7 +31,7 @@ callViaPtr(NOARGFUNPTR fptr) } void -callViaPtr2(ONEARGFUNPTR fptr, int arg) +callViaPtr2(ONEARGFUNPTR fptr, {type} arg) { (*fptr)(arg); }