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 };
19 static void _z80_init(void)
21 z80_opts.sub = SUB_Z80;
24 static void _gbz80_init(void)
26 z80_opts.sub = SUB_GBZ80;
29 static int regParmFlg = 0; /* determine if we can register a parameter */
31 static void _reset_regparm()
36 static int _reg_parm(link *l)
38 /* for this processor it is simple
39 can pass only the first parameter in a register */
48 static int _process_pragma(const char *sz)
50 printf("Got pragma \"%s\"\n", sz);
54 static bool _parseOptions(int *pargc, char **argv, int *i)
59 static void _finaliseOptions(void)
61 port->mem.default_local_map = data;
62 port->mem.default_globl_map = data;
65 static void _setDefaultOptions(void)
67 options.genericPtr = 1; /* default on */
69 options.stackAuto = 1;
70 options.mainreturn = 1;
71 options.noregparms = 1;
73 /* first the options part */
74 options.intlong_rent = 1;
76 optimize.global_cse = 1;
81 optimize.loopInvariant = 1;
82 optimize.loopInduction = 0;
85 static const char *_getRegName(struct regs *reg)
93 /** $1 is always the basename.
94 $2 is always the output file.
96 $l is the list of extra options that should be there somewhere...
97 MUST be terminated with a NULL.
99 static const char *_z80_linkCmd[] = {
100 "link-z80", "-nf", "$1", NULL
103 static const char *_z80_asmCmd[] = {
104 "as-z80", "-plosgff", "$1.o", "$1.asm", NULL
107 /** $1 is always the basename.
108 $2 is always the output file.
110 $l is the list of extra options that should be there somewhere...
111 MUST be terminated with a NULL.
113 static const char *_gbz80_linkCmd[] = {
114 "link-gbz80", "-nf", "$1", NULL
117 static const char *_gbz80_asmCmd[] = {
118 "as-gbz80", "-plosgff", "$1.o", "$1.asm", NULL
124 "Zilog Z80", /* Target name */
130 "-plosgff", /* Options with debug */
131 "-plosgff", /* Options without debug */
140 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
141 1, 1, 2, 4, 2, 2, 2, 1, 4, 4
162 /* Z80 has no native mul/div commands */
173 0, /* no assembler preamble */
174 0, /* no local IVT generation code */
182 "Gameboy Z80-like", /* Target name */
188 "-plosgff", /* Options with debug */
189 "-plosgff", /* Options without debug */
198 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
199 1, 1, 2, 4, 2, 2, 2, 1, 4, 4
220 /* gbZ80 has no native mul/div commands */
231 0, /* no assembler preamble */
232 0, /* no local IVT generation code */