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;
72 /* first the options part */
73 options.intlong_rent = 1;
75 optimize.global_cse = 1;
80 optimize.loopInvariant = 1;
81 optimize.loopInduction = 0;
84 static const char *_getRegName(struct regs *reg)
92 /** $1 is always the basename.
93 $2 is always the output file.
95 $l is the list of extra options that should be there somewhere...
96 MUST be terminated with a NULL.
98 static const char *_z80_linkCmd[] = {
99 "link-z80", "-nf", "$1", NULL
102 static const char *_z80_asmCmd[] = {
103 "as-z80", "-plosgff", "$1.o", "$1.asm", NULL
106 /** $1 is always the basename.
107 $2 is always the output file.
109 $l is the list of extra options that should be there somewhere...
110 MUST be terminated with a NULL.
112 static const char *_gbz80_linkCmd[] = {
113 "link-gbz80", "-nf", "$1", NULL
116 static const char *_gbz80_asmCmd[] = {
117 "as-gbz80", "-plosgff", "$1.o", "$1.asm", NULL
123 "Zilog Z80", /* Target name */
129 "-plosgff", /* Options with debug */
130 "-plosgff", /* Options without debug */
139 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
140 1, 1, 2, 4, 2, 2, 2, 1, 4, 4
161 /* Z80 has no native mul/div commands */
172 0, /* no assembler preamble */
173 0, /* no local IVT generation code */
181 "Gameboy Z80-like", /* Target name */
187 "-plosgff", /* Options with debug */
188 "-plosgff", /* Options without debug */
197 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
198 1, 1, 2, 4, 2, 2, 2, 1, 4, 4
219 /* gbZ80 has no native mul/div commands */
230 0, /* no assembler preamble */
231 0, /* no local IVT generation code */