X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fz80%2Fmain.c;h=0a5592a157de6ed9e2f36fc540b8089cb5f2d0f6;hb=d7b30120ae115e8929d57e25038ca76dde13974e;hp=f60636d7503425672f70761478c0fe0d3f1d60a3;hpb=c4b55ee40ddb79b816c42b1567dc9b5858153b66;p=fw%2Fsdcc diff --git a/src/z80/main.c b/src/z80/main.c index f60636d7..0a5592a1 100644 --- a/src/z80/main.c +++ b/src/z80/main.c @@ -1,6 +1,33 @@ +/*------------------------------------------------------------------------- + main.c - Z80 specific definitions. + + Michael Hope 2001 + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! +-------------------------------------------------------------------------*/ + +#include #include "z80.h" #include "MySystem.h" #include "BuildCmd.h" +#include "SDCCutil.h" +#include "dbuf.h" static char _z80_defaultRules[] = { @@ -16,18 +43,34 @@ static char _gbz80_defaultRules[] = Z80_OPTS z80_opts; +static OPTION _z80_options[] = + { + { 0, "--callee-saves-bc", &z80_opts.calleeSavesBC, "Force a called function to always save BC" }, + { 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 } + }; + typedef enum { /* Must be first */ ASM_TYPE_ASXXXX, ASM_TYPE_RGBDS, - ASM_TYPE_ISAS + ASM_TYPE_ISAS, + ASM_TYPE_Z80ASM } ASM_TYPE; static struct { ASM_TYPE asmType; + /* determine if we can register a parameter */ + int regParams; } _G; @@ -36,6 +79,10 @@ static char *_keywords[] = "sfr", "nonbanked", "banked", + "at", //.p.t.20030714 adding support for 'sfr at ADDR' construct + "_naked", //.p.t.20030714 adding support for '_naked' functions + "critical", + "interrupt", NULL }; @@ -44,6 +91,14 @@ extern PORT z80_port; #include "mappings.i" +static builtins _z80_builtins[] = { + /* Disabled for now. + { "__builtin_strcpy", "v", 2, {"cg*", "cg*" } }, + { "__builtin_memcpy", "cg*", 3, {"cg*", "cg*", "ui" } }, + */ + { NULL , NULL,0, {NULL}} +}; + static void _z80_init (void) { @@ -57,16 +112,14 @@ _gbz80_init (void) z80_opts.sub = SUB_GBZ80; } -static int regParmFlg = 0; /* determine if we can register a parameter */ - static void -_reset_regparm () +_reset_regparm (void) { - regParmFlg = 0; + _G.regParams = 0; } static int -_reg_parm (sym_link * l) +_reg_parm (sym_link * l, bool reentrant) { if (options.noRegParams) { @@ -74,102 +127,166 @@ _reg_parm (sym_link * l) } else { - if (regParmFlg == 2) + if (_G.regParams == 2) { return FALSE; } else { - regParmFlg++; + _G.regParams++; return TRUE; } } } -static bool -_startsWith (const char *sz, const char *key) -{ - return !strncmp (sz, key, strlen (key)); -} - -static void -_chomp (char *sz) -{ - char *nl; - while ((nl = strrchr (sz, '\n'))) - *nl = '\0'; -} +enum { + P_BANK = 1, + P_PORTMODE +}; static int -_process_pragma (const char *sz) +do_pragma(int id, const char *name, const char *cp) { - if (_startsWith (sz, "bank=")) + struct pragma_token_s token; + int err = 0; + int processed = 1; + + init_pragma_token(&token); + + switch (id) { - char buffer[128]; - strcpy (buffer, sz + 5); - _chomp (buffer); - if (isdigit (buffer[0])) - { + case P_BANK: + { + char buffer[128]; + + cp = get_pragma_token(cp, &token); + + switch (token.type) + { + case TOKEN_EOL: + err = 1; + break; + + case TOKEN_INT: + switch (_G.asmType) + { + case ASM_TYPE_ASXXXX: + sprintf(buffer, "CODE_%d", token.val.int_val); + break; + + case ASM_TYPE_RGBDS: + sprintf(buffer, "CODE,BANK[%d]", token.val.int_val); + break; + + case ASM_TYPE_ISAS: + /* PENDING: what to use for ISAS? */ + sprintf (buffer, "CODE,BANK(%d)", token.val.int_val); + break; + + default: + wassert (0); + } + break; + + default: + { + const char *str = get_pragma_string(&token); + + strncpyz(buffer, (0 == strcmp("BASE", str)) ? "HOME" : str, sizeof buffer); + } + break; + } + + cp = get_pragma_token(cp, &token); + if (TOKEN_EOL != token.type) + { + err = 1; + break; + } + + gbz80_port.mem.code_name = Safe_strdup (buffer); + code->sname = gbz80_port.mem.code_name; + options.code_seg = gbz80_port.mem.code_name; + } + break; + + case P_PORTMODE: + { /*.p.t.20030716 - adding pragma to manipulate z80 i/o port addressing modes */ + const char *str; + + cp = get_pragma_token(cp, &token); + + if (TOKEN_EOL == token.type) + { + err = 1; + break; + } + + str = get_pragma_string(&token); + + cp = get_pragma_token(cp, &token); + if (TOKEN_EOL != token.type) + { + err = 1; + break; + } + + if (!strcmp(str, "z80")) + { z80_opts.port_mode = 80; } + else if(!strcmp(str, "z180")) + { z80_opts.port_mode = 180; } + else if(!strcmp(str, "save")) + { z80_opts.port_back = z80_opts.port_mode; } + else if(!strcmp(str, "restore" )) + { z80_opts.port_mode = z80_opts.port_back; } + else + err = 1; + } + break; + + default: + processed = 0; + break; + } - } - else if (!strcmp (buffer, "BASE")) - { - strcpy (buffer, "HOME"); - } - if (isdigit (buffer[0])) - { - /* Arg was a bank number. Handle in an ASM independent - way. */ - char num[128]; - strcpy (num, sz + 5); - _chomp (num); + get_pragma_token(cp, &token); - switch (_G.asmType) - { - case ASM_TYPE_ASXXXX: - sprintf (buffer, "CODE_%s", num); - break; - case ASM_TYPE_RGBDS: - sprintf (buffer, "CODE,BANK[%s]", num); - break; - case ASM_TYPE_ISAS: - /* PENDING: what to use for ISAS? */ - sprintf (buffer, "CODE,BANK(%s)", num); - break; - default: - wassert (0); - } - } - gbz80_port.mem.code_name = gc_strdup (buffer); - code->sname = gbz80_port.mem.code_name; - return 0; - } - return 1; + if (1 == err) + werror(W_BAD_PRAGMA_ARGUMENTS, name); + + free_pragma_token(&token); + return processed; +} + +static struct pragma_s pragma_tbl[] = { + { "bank", P_BANK, 0, do_pragma }, + { "portmode", P_PORTMODE, 0, do_pragma }, + { NULL, 0, 0, NULL }, + }; + +static int +_process_pragma(const char *s) +{ + return process_pragma_tbl(pragma_tbl, s); } static const char *_gbz80_rgbasmCmd[] = { - "rgbasm", "-o$1.o", "$1.asm", NULL + "rgbasm", "-o\"$1.o\"", "\"$1.asm\"", NULL }; static const char *_gbz80_rgblinkCmd[] = { - "xlink", "-tg", "-n$1.sym", "-m$1.map", "-zFF", "$1.lnk", NULL + "xlink", "-tg", "-n\"$1.sym\"", "-m\"$1.map\"", "-zFF", "\"$1.lnk\"", NULL }; static void _gbz80_rgblink (void) { FILE *lnkfile; - const char *sz; - - int i; - sz = srcFileName; - if (!sz) - sz = "a"; /* first we need to create the .lnk file */ - sprintf (scratchFileName, "%s.lnk", sz); + sprintf (scratchFileName, "%s.lnk", dstFileName); if (!(lnkfile = fopen (scratchFileName, "w"))) { werror (E_FILE_OPEN_ERR, scratchFileName); @@ -178,23 +295,19 @@ _gbz80_rgblink (void) fprintf (lnkfile, "[Objects]\n"); - if (srcFileName) - fprintf (lnkfile, "%s.o\n", sz); + fprintf (lnkfile, "%s.o\n", dstFileName); - for (i = 0; i < nrelFiles; i++) - fprintf (lnkfile, "%s\n", relFiles[i]); + fputStrSet(lnkfile, relFilesSet); fprintf (lnkfile, "\n[Libraries]\n"); /* additional libraries if any */ - for (i = 0; i < nlibFiles; i++) - fprintf (lnkfile, "%s\n", libFiles[i]); - + fputStrSet(lnkfile, libFilesSet); - fprintf (lnkfile, "\n[Output]\n" "%s.gb", sz); + fprintf (lnkfile, "\n[Output]\n" "%s.gb", dstFileName); fclose (lnkfile); - buildCmdLine (buffer,port->linker.cmd, sz, NULL, NULL, NULL); + buildCmdLine (buffer,port->linker.cmd, dstFileName, NULL, NULL, NULL); /* call the linker */ if (my_system (buffer)) { @@ -217,12 +330,13 @@ _parseOptions (int *pargc, char **argv, int *i) case 'o': /* ROM bank */ sprintf (buffer, "CODE_%u", bank); - gbz80_port.mem.code_name = gc_strdup (buffer); + gbz80_port.mem.code_name = Safe_strdup (buffer); + options.code_seg = gbz80_port.mem.code_name; return TRUE; case 'a': /* RAM bank */ sprintf (buffer, "DATA_%u", bank); - gbz80_port.mem.data_name = gc_strdup (buffer); + gbz80_port.mem.data_name = Safe_strdup (buffer); return TRUE; } } @@ -250,11 +364,109 @@ _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; + } } + 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; } +static void +_setValues(void) +{ + const char *s; + + if (options.nostdlib == FALSE) + { + const char *s; + char path[PATH_MAX]; + struct dbuf_s dbuf; + + dbuf_init(&dbuf, PATH_MAX); + + for (s = setFirstItem(libDirsSet); s != NULL; s = setNextItem(libDirsSet)) + { + buildCmdLine2(path, sizeof path, "-k\"%s" DIR_SEPARATOR_STRING "{port}\" ", s); + dbuf_append(&dbuf, path, strlen(path)); + } + buildCmdLine2(path, sizeof path, "-l\"{port}.lib\"", s); + dbuf_append(&dbuf, path, strlen(path)); + + setMainValue ("z80libspec", dbuf_c_str(&dbuf)); + dbuf_destroy(&dbuf); + + for (s = setFirstItem(libDirsSet); s != NULL; s = setNextItem(libDirsSet)) + { + struct stat stat_buf; + + buildCmdLine2(path, sizeof path, "%s" DIR_SEPARATOR_STRING "{port}" DIR_SEPARATOR_STRING "crt0{objext}", s); + if (stat(path, &stat_buf) == 0) + break; + } + + if (s == NULL) + setMainValue ("z80crt0", "\"crt0{objext}\""); + else + { + char *buf; + size_t len = strlen(path) + 3; + + buf = Safe_alloc(len); + SNPRINTF(buf, len, "\"%s\"", path); + setMainValue("z80crt0", buf); + Safe_free(buf); + } + } + else + { + setMainValue ("z80libspec", ""); + setMainValue ("z80crt0", ""); + } + + setMainValue ("z80extralibfiles", (s = joinStrSet(libFilesSet))); + Safe_free((void *)s); + setMainValue ("z80extralibpaths", (s = joinStrSet(libPathsSet))); + Safe_free((void *)s); + + if (IS_GB) + { + setMainValue ("z80outputtypeflag", "-z"); + setMainValue ("z80outext", ".gb"); + } + else + { + setMainValue ("z80outputtypeflag", "-i"); + setMainValue ("z80outext", ".ihx"); + } + + setMainValue ("stdobjdstfilename" , "{dstfilename}{objext}"); + setMainValue ("stdlinkdstfilename", "{dstfilename}{z80outext}"); + + setMainValue ("z80extraobj", (s = joinStrSet(relFilesSet))); + Safe_free((void *)s); + + sprintf (buffer, "-b_CODE=0x%04X -b_DATA=0x%04X", options.code_loc, options.data_loc); + setMainValue ("z80bases", buffer); +} + static void _finaliseOptions (void) { @@ -262,21 +474,31 @@ _finaliseOptions (void) port->mem.default_globl_map = data; if (_G.asmType == ASM_TYPE_ASXXXX && IS_GB) asm_addTree (&_asxxxx_gb); + + _setValues(); } static void _setDefaultOptions (void) { - options.genericPtr = 1; /* default on */ options.nopeep = 0; options.stackAuto = 1; options.mainreturn = 1; /* first the options part */ options.intlong_rent = 1; + options.float_rent = 1; options.noRegParams = 1; /* Default code and data locations. */ options.code_loc = 0x200; - options.data_loc = 0x8000; + + if (IS_GB) + { + options.data_loc = 0xC000; + } + else + { + options.data_loc = 0x8000; + } optimize.global_cse = 1; optimize.label1 = 1; @@ -312,149 +534,94 @@ _mangleSupportFunctionName(char *original) { char buffer[128]; - if (TARGET_IS_Z80) - { - sprintf(buffer, "%s_rr%s_%s", original, - options.profile ? "f" : "x", - options.noRegParams ? "s" : "bds" - ); - } - else - { - strcpy(buffer, original); - } + sprintf(buffer, "%s_rr%s_%s", original, + options.profile ? "f" : "x", + options.noRegParams ? "s" : "bds" + ); - return gc_strdup(buffer); + return Safe_strdup(buffer); } static const char * _getRegName (struct regs *reg) { if (reg) - return reg->name; - assert (0); + { + return reg->name; + } + /* assert (0); */ return "err"; } -/** $1 is always the basename. - $2 is always the output file. - $3 varies - $l is the list of extra options that should be there somewhere... - MUST be terminated with a NULL. -*/ -static const char *_z80_linkCmd[] = -{ - "link-z80", - "-n", // Don't echo output - "-c", // Command line input - "--", // Again, command line input... - "-b_CODE=0x200", // Code starts at 0x200 - "-b_DATA=0x8000", // RAM starts at 0x8000 - "-j", // Output a symbol file as well - "-k" SDCC_LIB_DIR "/z80", // Library path - "-lz80.lib", // Library to use - "-i", // Output Intel IHX - "$1.ihx", // Output to - SDCC_LIB_DIR "/z80/crt0.o", // Link in crt0 first - "$1.o", // Actual code - NULL -}; - -/* sprintf that appends to the string. */ -static void -_saprintf(char *pinto, const char *format, ...) +static bool +_hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right) { - va_list ap; - va_start(ap, format); + sym_link *test = NULL; + value *val; - vsprintf(pinto + strlen(pinto), format, ap); - va_end(ap); -} - -static void -_z80_link(void) -{ - int i; - // PENDING - char buffer[2048]; - - sprintf(buffer, - "link-z80 " - "-n " // Don't echo output - "-c " // Command line input - "-- " // Again, command line input... - "-b_CODE=0x%04X " // Code starts at 0x200 - "-b_DATA=0x%04X " // RAM starts at 0x8000 - "-j ", // Output a symbol file as well - options.code_loc, - options.data_loc - ); - - // Add the standard lib in. - if (options.nostdlib == FALSE) { - _saprintf(buffer, - "-k" SDCC_LIB_DIR "/z80 " // Library path - "-lz80.lib " // Library to use - ); + if ( ic->op != '*') + { + return FALSE; } - // Add in the library paths and libraries - for (i = 0; i < nlibFiles; i++) { - _saprintf(buffer, "-k%s ", libFiles[i]); + if ( IS_LITERAL (left)) + { + test = left; + val = OP_VALUE (IC_LEFT (ic)); } - for (i = 0; i < nlibPaths; i++) { - _saprintf(buffer, "-l%s ", libPaths[i]); + else if ( IS_LITERAL (right)) + { + test = left; + val = OP_VALUE (IC_RIGHT (ic)); } - - _saprintf(buffer, - "-i " // Output Intel IHX - "%s.ihx ", // Output to - srcFileName - ); - - if (options.nostdlib == FALSE) { - _saprintf(buffer, - SDCC_LIB_DIR "/z80/crt0.o " // Link in crt0 first - ); + else + { + return FALSE; } - _saprintf(buffer, - "%s.o ", // Actual code - srcFileName - ); - - // Append all the other targets - for (i = 0; i < nrelFiles; i++) { - _saprintf(buffer, "%s ", relFiles[i]); + if ( getSize (test) <= 2) + { + return TRUE; } - // Do it. - if (my_system (buffer)) { - exit(1); - } + return FALSE; } -static const char *_z80_asmCmd[] = +/* Indicate which extended bit operations this port supports */ +static bool +hasExtBitOp (int op, int size) { - "as-z80", "-plosgff", "$1.o", "$1.asm", NULL -}; + if (op == GETHBIT) + return TRUE; + else + return FALSE; +} -/** $1 is always the basename. - $2 is always the output file. - $3 varies - $l is the list of extra options that should be there somewhere... - MUST be terminated with a NULL. -*/ -static const char *_gbz80_linkCmd[] = +/* Indicate the expense of an access to an output storage class */ +static int +oclsExpense (struct memmap *oclass) { - // PENDING - "link-gbz80", "-nf", "$1", NULL -}; + if (IN_FARSPACE(oclass)) + return 1; + + return 0; +} -static const char *_gbz80_asmCmd[] = -{ - "as-gbz80", "-plosgff", "$1.o", "$1.asm", NULL -}; + +#define LINKCMD "link-{port} -nf {dstfilename}" +/* +#define LINKCMD \ + "link-{port} -n -c -- {z80bases} -m -j" \ + " {z80libspec}" \ + " {z80extralibfiles} {z80extralibpaths}" \ + " {z80outputtypeflag} \"{linkdstfilename}\"" \ + " {z80crt0}" \ + " \"{dstfilename}{objext}\"" \ + " {z80extraobj}" +*/ + +#define ASMCMD \ + "as-{port} -plosgff \"{objdstfilename}\" \"{dstfilename}{asmext}\"" /* Globals */ PORT z80_port = @@ -462,22 +629,27 @@ PORT z80_port = TARGET_ID_Z80, "z80", "Zilog Z80", /* Target name */ + NULL, /* Processor name */ { + glue, FALSE, MODEL_MEDIUM | MODEL_SMALL, MODEL_SMALL }, { - _z80_asmCmd, + NULL, + ASMCMD, "-plosgff", /* Options with debug */ "-plosgff", /* Options without debug */ 0, ".asm" }, { - _z80_linkCmd, - _z80_link, - ".o" + NULL, + LINKCMD, + NULL, + ".o", + 1 }, { _z80_defaultRules @@ -486,12 +658,15 @@ PORT z80_port = /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ 1, 2, 2, 4, 2, 2, 2, 1, 4, 4 }, + /* tags for generic pointers */ + { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */ { "XSEG", "STACK", "CODE", "DATA", "ISEG", + NULL, /* pdata */ "XSEG", "BSEG", "RSEG", @@ -499,10 +674,17 @@ PORT z80_port = "OVERLAY", "GSFINAL", "HOME", + NULL, /* xidata */ + NULL, /* xinit */ + NULL, /* const_name */ + "CABS", /* cabs_name */ + NULL, /* xabs_name */ + NULL, /* iabs_name */ NULL, NULL, 1 }, + { NULL, NULL }, { -1, 0, 0, 4, 0, 2 }, @@ -510,21 +692,43 @@ 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, _getRegName, _keywords, 0, /* no assembler preamble */ + NULL, /* no genAssemblerEnd */ 0, /* no local IVT generation code */ + 0, /* no genXINIT code */ + NULL, /* genInitStartup */ _reset_regparm, _reg_parm, _process_pragma, _mangleSupportFunctionName, + _hasNativeMulFor, + hasExtBitOp, /* hasExtBitOp */ + oclsExpense, /* oclsExpense */ TRUE, + TRUE, /* little endian */ 0, /* leave lt */ 0, /* leave gt */ 1, /* transform <= to ! > */ @@ -532,6 +736,11 @@ PORT z80_port = 1, /* transform != to !(a == b) */ 0, /* leave == */ 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 }; @@ -541,36 +750,45 @@ PORT gbz80_port = TARGET_ID_GBZ80, "gbz80", "Gameboy Z80-like", /* Target name */ + NULL, { + glue, FALSE, MODEL_MEDIUM | MODEL_SMALL, MODEL_SMALL }, { - _gbz80_asmCmd, + NULL, + ASMCMD, "-plosgff", /* Options with debug */ "-plosgff", /* Options without debug */ - 1, - ".asm" + 0, + ".asm", + NULL /* no do_assemble function */ }, { - _gbz80_linkCmd, NULL, - ".o" + LINKCMD, + NULL, + ".o", + 1 }, { _gbz80_defaultRules }, { - /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ - 1, 1, 2, 4, 2, 2, 2, 1, 4, 4 + /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */ + 1, 2, 2, 4, 2, 2, 2, 1, 4, 4 }, + /* tags for generic pointers */ + { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */ { "XSEG", "STACK", "CODE", "DATA", "ISEG", + NULL, /* pdata */ "XSEG", "BSEG", "RSEG", @@ -578,10 +796,17 @@ PORT gbz80_port = "OVERLAY", "GSFINAL", "HOME", + NULL, /* xidata */ + NULL, /* xinit */ + NULL, /* const_name */ + "CABS", /* cabs_name */ + NULL, /* xabs_name */ + NULL, /* iabs_name */ NULL, NULL, 1 }, + { NULL, NULL }, { -1, 0, 0, 2, 0, 4 }, @@ -589,27 +814,54 @@ 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, + _gbz80_options, + NULL, _finaliseOptions, _setDefaultOptions, z80_assignRegisters, _getRegName, _keywords, 0, /* no assembler preamble */ + NULL, /* no genAssemblerEnd */ 0, /* no local IVT generation code */ + 0, /* no genXINIT code */ + NULL, /* genInitStartup */ _reset_regparm, _reg_parm, _process_pragma, - NULL, + _mangleSupportFunctionName, + _hasNativeMulFor, + hasExtBitOp, /* hasExtBitOp */ + oclsExpense, /* oclsExpense */ TRUE, + TRUE, /* little endian */ 0, /* leave lt */ 0, /* leave gt */ 1, /* transform <= to ! > */ 1, /* transform >= to ! < */ 1, /* transform != to !(a == b) */ 0, /* leave == */ - FALSE, /* No array initializer support. */ + TRUE, /* Array initializer support. */ + 0, /* no CSE cost estimation yet */ + NULL, /* no builtin functions */ + GPOINTER, /* treat unqualified pointers as "generic" pointers */ + 1, /* reset labelKey to 1 */ + 1, /* globals & local static allowed */ PORT_MAGIC };