2 ds390 specific general functions.
4 Note that mlh prepended _ds390_ on the static functions. Makes
5 it easier to set a breakpoint using the debugger.
12 static char _defaultRules[] =
17 /* list of key words used by msc51 */
18 static char *_ds390_keywords[] =
46 void ds390_assignRegisters (eBBlock ** ebbs, int count);
48 static int regParmFlg = 0; /* determine if we can register a parameter */
53 asm_addTree (&asm_asxxxx_mapping);
57 _ds390_reset_regparm ()
63 _ds390_regparm (sym_link * l)
65 /* for this processor it is simple
66 can pass only the first parameter in a register */
75 _ds390_parseOptions (int *pargc, char **argv, int *i)
77 /* TODO: allow port-specific command line options to specify
84 _ds390_finaliseOptions (void)
86 /* Hack-o-matic: if we are using the flat24 model,
87 * adjust pointer sizes.
89 if (options.model != MODEL_FLAT24)
92 "*** warning: ds390 port only supports the flat24 model.\n");
93 options.model = MODEL_FLAT24;
95 port->s.fptr_size = 3;
96 port->s.gptr_size = 4;
97 port->stack.isr_overhead++; /* Will save dpx on ISR entry. */
99 port->stack.call_overhead++; /* This acounts for the extra byte
100 * of return addres on the stack.
101 * but is ugly. There must be a
108 port->mem.default_local_map = xdata;
109 port->mem.default_globl_map = xdata;
113 port->mem.default_local_map = data;
114 port->mem.default_globl_map = data;
117 if (options.stack10bit)
119 if (options.model != MODEL_FLAT24)
122 "*** warning: 10 bit stack mode is only supported in flat24 model.\n");
123 fprintf (stderr, "\t10 bit stack mode disabled.\n");
124 options.stack10bit = 0;
128 /* Fixup the memory map for the stack; it is now in
129 * far space and requires a FPOINTER to access it.
132 istack->ptrType = FPOINTER;
138 _ds390_setDefaultOptions (void)
143 _ds390_getRegName (struct regs *reg)
151 _ds390_genAssemblerPreamble (FILE * of)
153 if (options.model == MODEL_FLAT24)
155 fputs (".flat24 on\t\t; 24 bit flat addressing\n", of);
156 fputs ("dpx = 0x93\t\t; dpx register unknown to assembler\n", of);
157 fputs ("dps = 0x86\t\t; dps register unknown to assembler\n", of);
158 fputs ("dpl1 = 0x84\t\t; dpl1 register unknown to assembler\n", of);
159 fputs ("dph1 = 0x85\t\t; dph1 register unknown to assembler\n", of);
160 fputs ("dpx1 = 0x95\t\t; dpx1 register unknown to assembler\n", of);
161 fputs ("ap = 0x9C\t\t; ap register unknown to assembler\n", of);
165 /* Generate interrupt vector table. */
167 _ds390_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
171 if (options.model != MODEL_FLAT24)
173 /* Let the default code handle it. */
177 fprintf (of, "\tajmp\t__sdcc_gsinit_startup\n");
179 /* now for the other interrupts */
180 for (i = 0; i < maxInterrupts; i++)
184 fprintf (of, "\tljmp\t%s\n\t.ds\t4\n", interrupts[i]->rname);
188 fprintf (of, "\treti\n\t.ds\t7\n");
195 /** $1 is always the basename.
196 $2 is always the output file.
198 $l is the list of extra options that should be there somewhere...
199 MUST be terminated with a NULL.
201 static const char *_linkCmd[] =
203 "aslink", "-nf", "$1", NULL
206 static const char *_asmCmd[] =
208 "asx8051", "-plosgff", "$1.asm", NULL
215 "DS80C390", /* Target name */
217 TRUE, /* Emit glue around main */
218 MODEL_SMALL | MODEL_LARGE | MODEL_FLAT24,
223 "-plosgffc", /* Options with debug */
224 "-plosgff", /* Options without debug */
236 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
237 1, 1, 2, 4, 1, 2, 3, 1, 4, 4
259 /* ds390 has an 8 bit mul */
266 _ds390_finaliseOptions,
267 _ds390_setDefaultOptions,
268 ds390_assignRegisters,
271 _ds390_genAssemblerPreamble,
273 _ds390_reset_regparm,
279 1, /* transform <= to ! > */
280 1, /* transform >= to ! < */
281 1, /* transform != to !(a == b) */