2 Extra bits ontop of the z80 port to target the Gameboy's Z80 like
5 Michael Hope <michaelh@earthling.net> 2000
10 static char _defaultRules[] =
13 #include "peeph-gbz80.rul"
16 static char *_gbz80_keywords[] = { NULL };
18 static bool _gbz80_parseOptions(int *pargc, char **argv, int *i)
23 static void _gbz80_init(void)
25 z80_opts.sub = SUB_GBZ80;
28 static void _gbz80_finaliseOptions(void)
30 port->mem.default_local_map = data;
31 port->mem.default_globl_map = data;
34 static void _gbz80_setDefaultOptions(void)
36 options.genericPtr = 1; /* default on */
38 options.stackAuto = 1;
39 options.mainreturn = 1;
40 options.noregparms = 1;
41 /* first the options part */
42 options.intlong_rent = 1;
44 optimize.global_cse = 1;
49 optimize.loopInvariant = 1;
50 optimize.loopInduction = 0;
53 static const char *_gbz80_getRegName(struct regs *reg)
61 /** $1 is always the basename.
62 $2 is always the output file.
64 $l is the list of extra options that should be there somewhere...
65 MUST be terminated with a NULL.
67 static const char *_linkCmd[] = {
68 "link-gbz80", "-nf", "$1", NULL
71 static const char *_asmCmd[] = {
72 "as-gbz80", "-plosgff", "$1.o", "$1.asm", NULL
78 "Gameboy Z80-like", /* Target name */
84 "-plosgff", /* Options with debug */
85 "-plosgff", /* Options without debug */
94 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
95 1, 1, 2, 4, 2, 2, 2, 1, 4, 4
115 /* Z80 has no native mul/div commands */
121 _gbz80_finaliseOptions,
122 _gbz80_setDefaultOptions,
126 0, /* no assembler preamble */
127 0, /* no local IVT generation code */