Added -p command line option to allow selection of port dependent processor.
[fw/sdcc] / src / z80 / main.c
index 0f9f5a81221f7b90582c0a1d4e6632244c0e74b3..81c9a80b9c76850171806b6d4a0e10bb065aeeea 100644 (file)
@@ -46,7 +46,8 @@ typedef enum
     /* Must be first */
     ASM_TYPE_ASXXXX,
     ASM_TYPE_RGBDS,
-    ASM_TYPE_ISAS
+    ASM_TYPE_ISAS,
+    ASM_TYPE_Z80ASM
   }
 ASM_TYPE;
 
@@ -269,6 +270,13 @@ _parseOptions (int *pargc, char **argv, int *i)
              _G.asmType = ASM_TYPE_ISAS;
              return TRUE;
            }
+         else if (!strcmp (argv[*i], "--asm=z80asm"))
+           {
+              port->assembler.externGlobal = TRUE;
+             asm_addTree (&_z80asm_z80);
+             _G.asmType = ASM_TYPE_ISAS;
+             return TRUE;
+           }
        }
     }
   return FALSE;
@@ -447,6 +455,7 @@ PORT z80_port =
   TARGET_ID_Z80,
   "z80",
   "Zilog Z80",                 /* Target name */
+  NULL,                                /* Processor name */
   {
     FALSE,
     MODEL_MEDIUM | MODEL_SMALL,
@@ -486,6 +495,8 @@ PORT z80_port =
     "OVERLAY",
     "GSFINAL",
     "HOME",
+    NULL, // xidata
+    NULL, // xinit
     NULL,
     NULL,
     1
@@ -506,7 +517,9 @@ PORT z80_port =
   _getRegName,
   _keywords,
   0,                           /* no assembler preamble */
+  NULL,                                /* no genAssemblerEnd */
   0,                           /* no local IVT generation code */
+  0,                            /* no genXINIT code */
   _reset_regparm,
   _reg_parm,
   _process_pragma,
@@ -522,6 +535,9 @@ PORT z80_port =
   TRUE,                         /* Array initializer support. */       
   0,                            /* no CSE cost estimation yet */
   _z80_builtins,               /* no builtin functions */
+  GPOINTER,                    /* treat unqualified pointers as "generic" pointers */
+  1,                           /* reset labelKey to 1 */
+  1,                           /* globals & local static allowed */
   PORT_MAGIC
 };
 
@@ -531,6 +547,7 @@ PORT gbz80_port =
   TARGET_ID_GBZ80,
   "gbz80",
   "Gameboy Z80-like",          /* Target name */
+  NULL,
   {
     FALSE,
     MODEL_MEDIUM | MODEL_SMALL,
@@ -542,7 +559,8 @@ PORT gbz80_port =
     "-plosgff",                        /* Options with debug */
     "-plosgff",                        /* Options without debug */
     0,
-    ".asm"
+    ".asm",
+    NULL                       /* no do_assemble function */
   },
   {
     NULL,
@@ -570,6 +588,8 @@ PORT gbz80_port =
     "OVERLAY",
     "GSFINAL",
     "HOME",
+    NULL, // xidata
+    NULL, // xinit
     NULL,
     NULL,
     1
@@ -590,7 +610,9 @@ PORT gbz80_port =
   _getRegName,
   _keywords,
   0,                           /* no assembler preamble */
+  NULL,                                /* no genAssemblerEnd */
   0,                           /* no local IVT generation code */
+  0,                            /* no genXINIT code */
   _reset_regparm,
   _reg_parm,
   _process_pragma,
@@ -605,6 +627,9 @@ PORT gbz80_port =
   0,                           /* leave == */
   TRUE,                         /* Array initializer support. */
   0,                            /* no CSE cost estimation yet */
-  NULL,                                /* no builtin functions */
+  NULL,                        /* no builtin functions */
+  GPOINTER,                    /* treat unqualified pointers as "generic" pointers */
+  1,                           /* reset labelKey to 1 */
+  1,                           /* globals & local static allowed */
   PORT_MAGIC
 };