2 mcs51 specific general functions.
4 Note that mlh prepended _mcs51_ on the static functions. Makes
5 it easier to set a breakpoint using the debugger.
11 /* list of key words used by msc51 */
12 static char *_mcs51_keywords[] = {
39 void mcs51_assignRegisters (eBBlock **ebbs, int count);
41 static bool _mcs51_parseOptions(int *pargc, char **argv, int *i)
43 /* TODO: allow port-specific command line options to specify
49 static void _mcs51_finaliseOptions(void)
51 /* Hack-o-matic: if we are using the flat24 model,
52 * adjust pointer sizes.
54 if (options.model == MODEL_FLAT24)
56 port->s.fptr_size = 3;
57 port->s.gptr_size = 4;
61 static void _mcs51_setDefaultOptions(void)
65 static const char *_mcs51_getRegName(struct regs *reg)
72 static void _mcs51_genAssemblerPreamble(FILE *of)
74 if (options.model == MODEL_FLAT24)
76 fputs(".flat24 on\t\t; 24 bit flat addressing\n", of);
77 fputs("dpx = 0x93\t\t; dpx register unknown to assembler\n", of);
82 /* Generate interrupt vector table. */
83 static int _mcs51_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
87 if (options.model != MODEL_FLAT24)
89 /* Let the default code handle it. */
93 fprintf (of, "\tajmp\t__sdcc_gsinit_startup\n");
95 /* now for the other interrupts */
96 for (i = 0; i < maxInterrupts; i++)
100 fprintf(of, "\tljmp\t%s\n\t.ds\t4\n", interrupts[i]->rname);
104 fprintf(of, "\treti\n\t.ds\t7\n");
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 *_linkCmd[] = {
118 "aslink", "-nf", "$1", NULL
121 static const char *_asmCmd[] = {
122 "asx8051", "-plosgffc", "$1.asm", NULL
128 "MCU 8051", /* Target name */
131 "-plosgffc", /* Options with debug */
132 "-plosgff", /* Options without debug */
138 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
139 1, 1, 2, 4, 1, 2, 3, 1, 4, 4
156 /* mcs51 has an 8 bit mul */
161 _mcs51_finaliseOptions,
162 _mcs51_setDefaultOptions,
163 mcs51_assignRegisters,
166 _mcs51_genAssemblerPreamble,