3 static char _z80_defaultRules[] =
6 #include "peeph-z80.rul"
9 static char _gbz80_defaultRules[] =
12 #include "peeph-gbz80.rul"
17 static char *_keywords[] = { NULL };
21 static void _z80_init(void)
23 z80_opts.sub = SUB_Z80;
24 asm_addTree(&_asxxxx_z80);
27 static void _gbz80_init(void)
29 z80_opts.sub = SUB_GBZ80;
30 asm_addTree(&_rgbds_gb);
33 static int regParmFlg = 0; /* determine if we can register a parameter */
35 static void _reset_regparm()
40 static int _reg_parm(link *l)
42 /* for this processor it is simple
43 can pass only the first parameter in a register */
52 static int _process_pragma(const char *sz)
54 printf("Got pragma \"%s\"\n", sz);
58 static bool _parseOptions(int *pargc, char **argv, int *i)
63 static void _finaliseOptions(void)
65 port->mem.default_local_map = data;
66 port->mem.default_globl_map = data;
69 static void _setDefaultOptions(void)
71 options.genericPtr = 1; /* default on */
73 options.stackAuto = 1;
74 options.mainreturn = 1;
75 options.noregparms = 1;
77 /* first the options part */
78 options.intlong_rent = 1;
80 optimize.global_cse = 1;
85 optimize.loopInvariant = 1;
86 optimize.loopInduction = 0;
89 static const char *_getRegName(struct regs *reg)
97 /** $1 is always the basename.
98 $2 is always the output file.
100 $l is the list of extra options that should be there somewhere...
101 MUST be terminated with a NULL.
103 static const char *_z80_linkCmd[] = {
104 "link-z80", "-nf", "$1", NULL
107 static const char *_z80_asmCmd[] = {
108 "as-z80", "-plosgff", "$1.o", "$1.asm", NULL
111 /** $1 is always the basename.
112 $2 is always the output file.
114 $l is the list of extra options that should be there somewhere...
115 MUST be terminated with a NULL.
117 static const char *_gbz80_linkCmd[] = {
118 "link-gbz80", "-nf", "$1", NULL
121 static const char *_gbz80_asmCmd[] = {
122 "as-gbz80", "-plosgff", "$1.o", "$1.asm", NULL
128 "Zilog Z80", /* Target name */
134 "-plosgff", /* Options with debug */
135 "-plosgff", /* Options without debug */
144 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
145 1, 1, 2, 4, 2, 2, 2, 1, 4, 4
166 /* Z80 has no native mul/div commands */
177 0, /* no assembler preamble */
178 0, /* no local IVT generation code */
186 "Gameboy Z80-like", /* Target name */
192 "-plosgff", /* Options with debug */
193 "-plosgff", /* Options without debug */
202 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
203 1, 1, 2, 4, 2, 2, 2, 1, 4, 4
224 /* gbZ80 has no native mul/div commands */
235 0, /* no assembler preamble */
236 0, /* no local IVT generation code */