* as/mcs51/lkarea.c: removed old K&R style,
[fw/sdcc] / src / z80 / main.c
index 0f9faade3bbfef50eb38e54fb9b481074fa3c8ad..8fb6b0a2d18ef96d13784d134f62ddb09dbb1e97 100644 (file)
@@ -46,7 +46,13 @@ Z80_OPTS z80_opts;
 static OPTION _z80_options[] = 
   {
     {  0,   "--callee-saves-bc", &z80_opts.calleeSavesBC, "Force a called function to always save BC" },
-    { 80,   "--portmode",        &z80_opts.port_mode,     "Determine PORT I/O mode (z80/z180)" },
+    {  0,   "--portmode=",       NULL,                    "Determine PORT I/O mode (z80/z180)" },
+    {  0, NULL }
+  };
+
+static OPTION _gbz80_options[] = 
+  {
+    {  0,   "--callee-saves-bc", &z80_opts.calleeSavesBC, "Force a called function to always save BC" },
     {  0, NULL }
   };
 
@@ -75,6 +81,7 @@ static char *_keywords[] =
   "banked",
   "at",       //.p.t.20030714 adding support for 'sfr at ADDR' construct
   "_naked",   //.p.t.20030714 adding support for '_naked' functions
+  "critical",
   NULL
 };
 
@@ -105,7 +112,7 @@ _gbz80_init (void)
 }
 
 static void
-_reset_regparm ()
+_reset_regparm (void)
 {
   _G.regParams = 0;
 }
@@ -304,6 +311,19 @@ _parseOptions (int *pargc, char **argv, int *i)
              return TRUE;
            }
        }
+      else if (!strncmp (argv[*i], "--portmode=", 11))
+       {
+         if (!strcmp (argv[*i], "--portmode=z80"))
+           {
+             z80_opts.port_mode =  80;
+             return TRUE;
+           }
+         else if (!strcmp (argv[*i], "--portmode=z180"))
+           {
+             z80_opts.port_mode =  180;
+             return TRUE;
+           }
+        }
     }
   return FALSE;
 }
@@ -583,6 +603,7 @@ PORT z80_port =
     "CODE",
     "DATA",
     "ISEG",
+    NULL, /* pdata */
     "XSEG",
     "BSEG",
     "RSEG",
@@ -604,10 +625,24 @@ PORT z80_port =
   {
     0, 2
   },
+  {
+    z80_emitDebuggerSymbol
+  },
+  {
+    255,        /* maxCount */
+    3,          /* sizeofElement */
+    /* The rest of these costs are bogus. They approximate */
+    /* the behavior of src/SDCCicode.c 1.207 and earlier.  */
+    {4,4,4},    /* sizeofMatchJump[] */
+    {0,0,0},    /* sizeofRangeCompare[] */
+    0,          /* sizeofSubtract */
+    3,          /* sizeofDispatch */
+  },
   "_",
   _z80_init,
   _parseOptions,
   _z80_options,
+  NULL,
   _finaliseOptions,
   _setDefaultOptions,
   z80_assignRegisters,
@@ -617,6 +652,7 @@ PORT z80_port =
   NULL,                                /* no genAssemblerEnd */
   0,                           /* no local IVT generation code */
   0,                            /* no genXINIT code */
+  NULL,                        /* genInitStartup */
   _reset_regparm,
   _reg_parm,
   _process_pragma,
@@ -683,6 +719,7 @@ PORT gbz80_port =
     "CODE",
     "DATA",
     "ISEG",
+    NULL, /* pdata */
     "XSEG",
     "BSEG",
     "RSEG",
@@ -704,10 +741,24 @@ PORT gbz80_port =
   {
     0, 2
   },
+  {
+    z80_emitDebuggerSymbol
+  },
+  {
+    255,        /* maxCount */
+    3,          /* sizeofElement */
+    /* The rest of these costs are bogus. They approximate */
+    /* the behavior of src/SDCCicode.c 1.207 and earlier.  */
+    {4,4,4},    /* sizeofMatchJump[] */
+    {0,0,0},    /* sizeofRangeCompare[] */
+    0,          /* sizeofSubtract */
+    3,          /* sizeofDispatch */
+  },
   "_",
   _gbz80_init,
   _parseOptions,
-  _z80_options,
+  _gbz80_options,
+  NULL,
   _finaliseOptions,
   _setDefaultOptions,
   z80_assignRegisters,
@@ -717,6 +768,7 @@ PORT gbz80_port =
   NULL,                                /* no genAssemblerEnd */
   0,                           /* no local IVT generation code */
   0,                            /* no genXINIT code */
+  NULL,                        /* genInitStartup */
   _reset_regparm,
   _reg_parm,
   _process_pragma,