From 30923bea1f970995f9a62ed12af2100737944882 Mon Sep 17 00:00:00 2001 From: kvigor Date: Wed, 9 Feb 2000 22:07:41 +0000 Subject: [PATCH] 24 bit flat mode: get call via function pointer working git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@92 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/mcs51/gen.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 6f3190ff..de443269 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -319,7 +319,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result) sym->aop = aop = newAsmop(AOP_IMMD); ALLOC_ATOMIC(aop->aopu.aop_immd,strlen(sym->rname)+1); strcpy(aop->aopu.aop_immd,sym->rname); - aop->size = 2; + aop->size = FPTRSIZE; return aop; } @@ -1741,11 +1741,17 @@ static void genPcall (iCode *ic) emitcode("push","acc"); emitcode("mov","a,#(%05d$ >> 8)",(rlbl->key+100)); emitcode("push","acc"); + + if (options.model == MODEL_FLAT24) + { + emitcode("mov","a,#(%05d$ >> 16)",(rlbl->key+100)); + emitcode("push","acc"); + } /* now push the calling address */ aopOp(IC_LEFT(ic),ic,FALSE); - pushSide(IC_LEFT(ic), 2); + pushSide(IC_LEFT(ic), FPTRSIZE); freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); -- 2.47.2