From: sandeep Date: Wed, 7 Nov 2001 06:14:25 +0000 (+0000) Subject: Disbale interrupt during Accelerator operations X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d937a0a990e7a8c0ce92e119d5c7550d34b11fb5;p=fw%2Fsdcc Disbale interrupt during Accelerator operations Use option to determine if Accelerator code should be generated git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1519 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/gen.c b/src/ds390/gen.c index d934902f..6f1f6e13 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -4092,6 +4092,13 @@ static void genMultTwoByte (operand *left, operand *right, right = left; left = t; } + /* save EA bit in F1 */ + lbl = newiTempLabel(NULL); + emitcode ("setb","F1"); + emitcode ("jbc","EA,%05d$",lbl->key+100); + emitcode ("clr","F1"); + emitcode("","%05d$:",lbl->key+100); + /* load up MB with right */ if (!umult) { emitcode("clr","F0"); @@ -4220,6 +4227,12 @@ static void genMultTwoByte (operand *left, operand *right, } freeAsmop (result, NULL, ic, TRUE); + + /* restore EA bit in F1 */ + lbl = newiTempLabel(NULL); + emitcode ("jnb","F1,%05d$",lbl->key+100); + emitcode ("setb","EA"); + emitcode("","%05d$:",lbl->key+100); return ; } @@ -4404,6 +4417,13 @@ static void genDivTwoByte (operand *left, operand *right, int umult = SPEC_USIGN(retype) | SPEC_USIGN(letype); symbol *lbl; + /* save EA bit in F1 */ + lbl = newiTempLabel(NULL); + emitcode ("setb","F1"); + emitcode ("jbc","EA,%05d$",lbl->key+100); + emitcode ("clr","F1"); + emitcode("","%05d$:",lbl->key+100); + /* load up MA with left */ if (!umult) { emitcode("clr","F0"); @@ -4495,6 +4515,11 @@ static void genDivTwoByte (operand *left, operand *right, aopPut(AOP(result),"a",1); } freeAsmop (result, NULL, ic, TRUE); + /* restore EA bit in F1 */ + lbl = newiTempLabel(NULL); + emitcode ("jnb","F1,%05d$",lbl->key+100); + emitcode ("setb","EA"); + emitcode("","%05d$:",lbl->key+100); return ; } @@ -4653,6 +4678,13 @@ static void genModTwoByte (operand *left, operand *right, symbol *lbl; /* load up MA with left */ + /* save EA bit in F1 */ + lbl = newiTempLabel(NULL); + emitcode ("setb","F1"); + emitcode ("jbc","EA,%05d$",lbl->key+100); + emitcode ("clr","F1"); + emitcode("","%05d$:",lbl->key+100); + if (!umult) { lbl = newiTempLabel(NULL); emitcode ("mov","b,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE)); @@ -4715,6 +4747,12 @@ static void genModTwoByte (operand *left, operand *right, aopPut(AOP(result),"mb",1); aopPut(AOP(result),"mb",0); freeAsmop (result, NULL, ic, TRUE); + + /* restore EA bit in F1 */ + lbl = newiTempLabel(NULL); + emitcode ("jnb","F1,%05d$",lbl->key+100); + emitcode ("setb","EA"); + emitcode("","%05d$:",lbl->key+100); return ; } diff --git a/src/ds390/main.c b/src/ds390/main.c index 89ea814a..17c9e482 100644 --- a/src/ds390/main.c +++ b/src/ds390/main.c @@ -121,6 +121,12 @@ _ds390_finaliseOptions (void) fprintf (stderr, "*** error: ds390 port only supports the 10 bit stack mode.\n"); } + + /* generate native code 16*16 mul/div */ + if (options.useAccelerator) + port->support.muldiv=2; + else + port->support.muldiv=1; /* Fixup the memory map for the stack; it is now in * far space and requires a FPOINTER to access it. @@ -162,6 +168,7 @@ _ds390_genAssemblerPreamble (FILE * of) fputs ("ma = 0xD3\t\t; ma register unknown to assembler\n", 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); } /* Generate interrupt vector table. */