Disbale interrupt during Accelerator operations
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 7 Nov 2001 06:14:25 +0000 (06:14 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 7 Nov 2001 06:14:25 +0000 (06:14 +0000)
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

src/ds390/gen.c
src/ds390/main.c

index d934902ff316569f0c6071d80aeab86ab81e0614..6f1f6e13448d0ed7df9fbc5249ec27934c251754 100644 (file)
@@ -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 ;
 }
 
index 89ea814a27652efecc7073ff297144135d0a4a1c..17c9e482cbdde436a76921d85cd99008cebc19c4 100644 (file)
@@ -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. */