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 static char _defaultRules[] =
16 /* list of key words used by msc51 */
17 static char *_mcs51_keywords[] = {
44 void mcs51_assignRegisters (eBBlock **ebbs, int count);
46 static bool _mcs51_parseOptions(int *pargc, char **argv, int *i)
48 /* TODO: allow port-specific command line options to specify
54 static void _mcs51_finaliseOptions(void)
56 /* Hack-o-matic: if we are using the flat24 model,
57 * adjust pointer sizes.
59 if (options.model == MODEL_FLAT24)
61 port->s.fptr_size = 3;
62 port->s.gptr_size = 4;
66 static void _mcs51_setDefaultOptions(void)
70 static const char *_mcs51_getRegName(struct regs *reg)
77 static void _mcs51_genAssemblerPreamble(FILE *of)
79 if (options.model == MODEL_FLAT24)
81 fputs(".flat24 on\t\t; 24 bit flat addressing\n", of);
82 fputs("dpx = 0x93\t\t; dpx register unknown to assembler\n", of);
87 /* Generate interrupt vector table. */
88 static int _mcs51_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
92 if (options.model != MODEL_FLAT24)
94 /* Let the default code handle it. */
98 fprintf (of, "\tajmp\t__sdcc_gsinit_startup\n");
100 /* now for the other interrupts */
101 for (i = 0; i < maxInterrupts; i++)
105 fprintf(of, "\tljmp\t%s\n\t.ds\t4\n", interrupts[i]->rname);
109 fprintf(of, "\treti\n\t.ds\t7\n");
116 /** $1 is always the basename.
117 $2 is always the output file.
119 $l is the list of extra options that should be there somewhere...
120 MUST be terminated with a NULL.
122 static const char *_linkCmd[] = {
123 "aslink", "-nf", "$1", NULL
126 static const char *_asmCmd[] = {
127 "asx8051", "-plosgffc", "$1.asm", NULL
133 "MCU 8051", /* Target name */
136 "-plosgffc", /* Options with debug */
137 "-plosgff", /* Options without debug */
146 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
147 1, 1, 2, 4, 1, 2, 3, 1, 4, 4
164 /* mcs51 has an 8 bit mul */
169 _mcs51_finaliseOptions,
170 _mcs51_setDefaultOptions,
171 mcs51_assignRegisters,
174 _mcs51_genAssemblerPreamble,