/* Must be first */
ASM_TYPE_ASXXXX,
ASM_TYPE_RGBDS,
- ASM_TYPE_ISAS
+ ASM_TYPE_ISAS,
+ ASM_TYPE_Z80ASM
}
ASM_TYPE;
#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)
{
_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;
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;
{
return reg->name;
}
- assert (0);
+ // assert (0);
return "err";
}
+static bool
+_hasNativeMulFor (iCode *ic, sym_link *left, sym_link *right)
+{
+ sym_link *test = NULL;
+ value *val;
+
+ if ( ic->op != '*')
+ {
+ return FALSE;
+ }
+
+ if ( IS_LITERAL (left))
+ {
+ test = left;
+ val = OP_VALUE (IC_LEFT (ic));
+ }
+ else if ( IS_LITERAL (right))
+ {
+ test = left;
+ val = OP_VALUE (IC_RIGHT (ic));
+ }
+ else
+ {
+ return FALSE;
+ }
+
+ if ( getSize (test) <= 2)
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
#define LINKCMD \
"{bindir}{sep}link-{port} -n -c -- {z80bases} -m -j" \
" {z80libspec}" \
"OVERLAY",
"GSFINAL",
"HOME",
+ NULL, // xidata
+ NULL, // xinit
NULL,
NULL,
1
_keywords,
0, /* no assembler preamble */
0, /* no local IVT generation code */
+ 0, /* no genXINIT code */
_reset_regparm,
_reg_parm,
_process_pragma,
_mangleSupportFunctionName,
+ _hasNativeMulFor,
TRUE,
0, /* leave lt */
0, /* leave gt */
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
};
"OVERLAY",
"GSFINAL",
"HOME",
+ NULL, // xidata
+ NULL, // xinit
NULL,
NULL,
1
_keywords,
0, /* no assembler preamble */
0, /* no local IVT generation code */
+ 0, /* no genXINIT code */
_reset_regparm,
_reg_parm,
_process_pragma,
_mangleSupportFunctionName,
+ _hasNativeMulFor,
TRUE,
0, /* leave lt */
0, /* leave gt */
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
};