From: johanknol Date: Fri, 16 Nov 2001 14:35:57 +0000 (+0000) Subject: let's try again: a small stack fix X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d1c2f49cd4b7cf542c02c606fff6e9c5e2e99509;p=fw%2Fsdcc let's try again: a small stack fix git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1604 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 3e23ce3e..3f00cf22 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -467,10 +467,10 @@ aopForSym (iCode * ic, symbol * sym, bool result, bool useDP2) ((short) (sym->stack - _G.nRegsSaved)) : ((short) sym->stack)) & 0xff); emitcode ("mov","b,a"); - emitcode ("mov","a,#0x%02x",(-((sym->stack < 0) ? + emitcode ("mov","a,_bpx+1"); + emitcode ("subb","a,#0x%02x",(-((sym->stack < 0) ? ((short) (sym->stack - _G.nRegsSaved)) : ((short) sym->stack)) >> 8) & 0xff); - emitcode ("subb","a,_bpx+1"); if (useDP2) { if (options.model == MODEL_FLAT24) emitcode ("mov", "dpx1,#0x40"); @@ -2875,7 +2875,7 @@ genFunction (iCode * ic) emitcode ("add","a,#0x%02x", ((short) sym->stack & 0xff)); emitcode ("mov","sp,a"); emitcode ("mov","a,esp"); - emitcode ("addc","a,0x%02x", (((short) sym->stack) >> 8) & 0xff); + emitcode ("addc","a,#0x%02x", (((short) sym->stack) >> 8) & 0xff); emitcode ("mov","esp,a"); } else { if (i > 256)