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[] =
47 void ds390_assignRegisters (eBBlock ** ebbs, int count);
49 static int regParmFlg = 0; /* determine if we can register a parameter */
54 asm_addTree (&asm_asxxxx_mapping);
58 _ds390_reset_regparm ()
64 _ds390_regparm (sym_link * l)
66 /* for this processor it is simple
67 can pass only the first parameter in a register */
76 _ds390_parseOptions (int *pargc, char **argv, int *i)
78 /* TODO: allow port-specific command line options to specify
85 _ds390_finaliseOptions (void)
87 /* Hack-o-matic: if we are using the flat24 model,
88 * adjust pointer sizes.
90 if (options.model != MODEL_FLAT24) {
92 "*** warning: ds390 port small and large model experimental.\n");
93 if (options.model == MODEL_LARGE)
95 port->mem.default_local_map = xdata;
96 port->mem.default_globl_map = xdata;
100 port->mem.default_local_map = data;
101 port->mem.default_globl_map = data;
105 port->s.fptr_size = 3;
106 port->s.gptr_size = 4;
108 port->stack.isr_overhead++; /* Will save dpx on ISR entry. */
110 port->stack.call_overhead++; /* This acounts for the extra byte
111 * of return addres on the stack.
112 * but is ugly. There must be a
116 port->mem.default_local_map = xdata;
117 port->mem.default_globl_map = xdata;
119 if (!options.stack10bit)
122 "*** error: ds390 port only supports the 10 bit stack mode.\n");
125 /* Fixup the memory map for the stack; it is now in
126 * far space and requires a FPOINTER to access it.
129 istack->ptrType = FPOINTER;
134 _ds390_setDefaultOptions (void)
136 options.model=MODEL_FLAT24;
137 options.stack10bit=1;
141 _ds390_getRegName (struct regs *reg)
149 _ds390_genAssemblerPreamble (FILE * of)
151 if (options.model == MODEL_FLAT24)
152 fputs (".flat24 on\t\t; 24 bit flat addressing\n", of);
154 fputs ("dpx = 0x93\t\t; dpx register unknown to assembler\n", of);
155 fputs ("dps = 0x86\t\t; dps register unknown to assembler\n", of);
156 fputs ("dpl1 = 0x84\t\t; dpl1 register unknown to assembler\n", of);
157 fputs ("dph1 = 0x85\t\t; dph1 register unknown to assembler\n", of);
158 fputs ("dpx1 = 0x95\t\t; dpx1 register unknown to assembler\n", of);
159 fputs ("ap = 0x9C\t\t; ap register unknown to assembler\n", of);
162 /* Generate interrupt vector table. */
164 _ds390_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
168 if (options.model != MODEL_FLAT24)
170 /* Let the default code handle it. */
174 fprintf (of, "\tajmp\t__sdcc_gsinit_startup\n");
176 /* now for the other interrupts */
177 for (i = 0; i < maxInterrupts; i++)
181 fprintf (of, "\tljmp\t%s\n\t.ds\t4\n", interrupts[i]->rname);
185 fprintf (of, "\treti\n\t.ds\t7\n");
192 /** $1 is always the basename.
193 $2 is always the output file.
195 $l is the list of extra options that should be there somewhere...
196 MUST be terminated with a NULL.
198 static const char *_linkCmd[] =
200 "aslink", "-nf", "$1", NULL
203 /* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */ static const char *_asmCmd[] =
205 "asx8051", "$l", "$3", "$1.asm", NULL
213 "DS80C390", /* Target name */
215 TRUE, /* Emit glue around main */
216 MODEL_SMALL | MODEL_LARGE | MODEL_FLAT24,
222 "-plosgffc", /* Options with debug */
223 "-plosgff", /* Options without debug */
237 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
238 1, 2, 2, 4, 1, 2, 3, 1, 4, 4
260 /* ds390 has an 8 bit mul */
267 _ds390_finaliseOptions,
268 _ds390_setDefaultOptions,
269 ds390_assignRegisters,
272 _ds390_genAssemblerPreamble,
274 _ds390_reset_regparm,
281 1, /* transform <= to ! > */
282 1, /* transform >= to ! < */
283 1, /* transform != to !(a == b) */
285 TRUE, /* we support array initializers. */