* as/mcs51/asexpr.c (expr): disabled warning "not in .flat24 mode",
[fw/sdcc] / src / ds390 / main.c
index a1ff41aa7e3e3468af083db56133437b1dffe2e5..639ab5df969230f386be201ddbe3f1b66ddfa9d8 100644 (file)
@@ -59,7 +59,7 @@ static builtins __ds390_builtins[] = {
     { "__builtin_memcmp_c2x","c",3,{"cx*","cp*","i"}}, /* void __builtin_memcmp_c2x (xdata char *,code  char *,int) */
     { NULL , NULL,0, {NULL}}                      /* mark end of table */
 };
-void ds390_assignRegisters (eBBlock ** ebbs, int count);
+void ds390_assignRegisters (ebbIndex * ebbi);
 
 static int regParmFlg = 0;     /* determine if we can register a parameter */
 
@@ -70,7 +70,7 @@ _ds390_init (void)
 }
 
 static void
-_ds390_reset_regparm ()
+_ds390_reset_regparm (void)
 {
   regParmFlg = 0;
 }
@@ -78,6 +78,8 @@ _ds390_reset_regparm ()
 static int
 _ds390_regparm (sym_link * l)
 {
+    if (IS_SPEC(l) && (SPEC_NOUN(l) == V_BIT))
+        return 0;
     if (options.parms_in_bank1 == 0) {
        /* simple can pass only the first parameter in a register */
        if (regParmFlg)
@@ -235,8 +237,25 @@ _ds390_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
 
   if (options.model != MODEL_FLAT24)
     {
-      /* Let the default code handle it. */
-      return FALSE;
+      fprintf (of, "\tljmp\t__sdcc_gsinit_startup\n");
+
+      /* now for the other interrupts */
+      for (i = 0; i < maxInterrupts; i++)
+        {
+          if (interrupts[i])
+            {
+              fprintf (of, "\tljmp\t%s\n", interrupts[i]->rname);
+              if ( i != maxInterrupts - 1 )
+                fprintf (of, "\t.ds\t5\n");
+            }
+          else
+            {
+              fprintf (of, "\treti\n");
+              if ( i != maxInterrupts - 1 )
+                fprintf (of, "\t.ds\t7\n");
+            }
+        }
+      return TRUE;
     }
 
   fprintf (of, "\tajmp\t__reset_vect\n");
@@ -846,6 +865,7 @@ PORT ds390_port =
     "CSEG    (CODE)",
     "DSEG    (DATA)",
     "ISEG    (DATA)",
+    "PSEG    (PAG,XDATA)",
     "XSEG    (XDATA)",
     "BSEG    (BIT)",
     "RSEG    (DATA)",
@@ -855,6 +875,7 @@ PORT ds390_port =
     "HOME    (CODE)",
     "XISEG   (XDATA)", // initialized xdata
     "XINIT   (CODE)", // a code copy of xiseg
+    "CONST   (CODE)",          // const_name - const data (code or not)
     NULL,
     NULL,
     1
@@ -983,7 +1004,7 @@ static void _tininative_finaliseOptions (void)
 
 static int _tininative_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
 {
-    return 1;
+    return TRUE;
 }
 static void _tininative_genAssemblerPreamble (FILE * of)
 {
@@ -1157,15 +1178,17 @@ PORT tininative_port =
     "CSEG    (CODE)",
     "DSEG    (DATA)",
     "ISEG    (DATA)",
+    "PSEG    (PAG,XDATA)",
     "XSEG    (XDATA)",
     "BSEG    (BIT)",
     "RSEG    (DATA)",
     "GSINIT  (CODE)",
     "OSEG    (OVR,DATA)",
     "GSFINAL (CODE)",
-    "HOME       (CODE)",
+    "HOME    (CODE)",
     NULL,
     NULL,
+    "CONST   (CODE)",          // const_name - const data (code or not)
     NULL,
     NULL,
     1
@@ -1383,6 +1406,7 @@ PORT ds400_port =
     "CSEG    (CODE)",
     "DSEG    (DATA)",
     "ISEG    (DATA)",
+    "PSEG    (PAG,XDATA)",
     "XSEG    (XDATA)",
     "BSEG    (BIT)",
     "RSEG    (DATA)",
@@ -1392,6 +1416,7 @@ PORT ds400_port =
     "HOME    (CODE)",
     "XISEG   (XDATA)", // initialized xdata
     "XINIT   (CODE)", // a code copy of xiseg
+    "CONST   (CODE)",          // const_name - const data (code or not)
     NULL,
     NULL,
     1