* Added support for doing shifts by helper functions
[fw/sdcc] / src / ds390 / main.c
index c17631f7d2d9c029bd251c3a2b0732ac7ed7b908..3bafacb7ce2cff0a826d7a1fe8c2b3aa65988fe9 100644 (file)
@@ -39,6 +39,7 @@ static char *_ds390_keywords[] =
   "_xdata",
   "_pdata",
   "_idata",
+  "_naked",
   NULL
 };
 
@@ -89,8 +90,8 @@ _ds390_finaliseOptions (void)
   if (options.model != MODEL_FLAT24)
     {
       fprintf (stderr,
-              "*** warning: ds390 port only supports the flat24 model.\n");
-      options.model = MODEL_FLAT24;
+              "*** error: ds390 port only supports the flat24 model.\n");
+      exit (1);
     }
   port->s.fptr_size = 3;
   port->s.gptr_size = 4;
@@ -103,40 +104,27 @@ _ds390_finaliseOptions (void)
                                 */
 #endif
 
-  if (options.model)
-    {
-      port->mem.default_local_map = xdata;
-      port->mem.default_globl_map = xdata;
-    }
-  else
-    {
-      port->mem.default_local_map = data;
-      port->mem.default_globl_map = data;
-    }
+  port->mem.default_local_map = xdata;
+  port->mem.default_globl_map = xdata;
 
-  if (options.stack10bit)
+  if (!options.stack10bit)
     {
-      if (options.model != MODEL_FLAT24)
-       {
-         fprintf (stderr,
-                  "*** warning: 10 bit stack mode is only supported in flat24 model.\n");
-         fprintf (stderr, "\t10 bit stack mode disabled.\n");
-         options.stack10bit = 0;
-       }
-      else
-       {
-         /* Fixup the memory map for the stack; it is now in
-          * far space and requires a FPOINTER to access it.
-          */
-         istack->fmap = 1;
-         istack->ptrType = FPOINTER;
-       }
+    fprintf (stderr,
+            "*** error: ds390 port only supports the 10 bit stack mode.\n");
     }
+
+  /* Fixup the memory map for the stack; it is now in
+   * far space and requires a FPOINTER to access it.
+   */
+  istack->fmap = 1;
+  istack->ptrType = FPOINTER;
 }
 
 static void
 _ds390_setDefaultOptions (void)
 {
+  options.model=MODEL_FLAT24;
+  options.stack10bit=1;
 }
 
 static const char *
@@ -205,12 +193,13 @@ static const char *_linkCmd[] =
 
 static const char *_asmCmd[] =
 {
-  "asx8051", "-plosgff", "$1.asm", NULL
+  "asx8051", "$l", "-plosgff", "$1.asm", NULL
 };
 
 /* Globals */
 PORT ds390_port =
 {
+  TARGET_ID_DS390,
   "ds390",
   "DS80C390",                  /* Target name */
   {
@@ -222,7 +211,8 @@ PORT ds390_port =
     _asmCmd,
     "-plosgffc",               /* Options with debug */
     "-plosgff",                        /* Options without debug */
-    0
+    0,
+    ".asm"
   },
   {
     _linkCmd,
@@ -234,7 +224,7 @@ PORT ds390_port =
   },
   {
        /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
-    1, 1, 2, 4, 1, 2, 3, 1, 4, 4
+    1, 2, 2, 4, 1, 2, 3, 1, 4, 4
   },
   {
     "XSEG    (XDATA)",
@@ -258,7 +248,7 @@ PORT ds390_port =
   },
     /* ds390 has an 8 bit mul */
   {
-    1, 0
+    1, -1
   },
   "_",
   _ds390_init,
@@ -273,6 +263,7 @@ PORT ds390_port =
   _ds390_reset_regparm,
   _ds390_regparm,
   NULL,
+  NULL,
   FALSE,
   0,                           /* leave lt */
   0,                           /* leave gt */