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.
12 static char _defaultRules[] =
17 /* list of key words used by msc51 */
18 static char *_mcs51_keywords[] =
46 void mcs51_assignRegisters (eBBlock ** ebbs, int count);
48 static int regParmFlg = 0; /* determine if we can register a parameter */
53 asm_addTree (&asm_asxxxx_mapping);
57 _mcs51_reset_regparm ()
63 _mcs51_regparm (sym_link * l)
65 /* for this processor it is simple
66 can pass only the first parameter in a register */
75 _mcs51_parseOptions (int *pargc, char **argv, int *i)
77 /* TODO: allow port-specific command line options to specify
84 _mcs51_finaliseOptions (void)
86 if (options.model == MODEL_LARGE) {
87 port->mem.default_local_map = xdata;
88 port->mem.default_globl_map = xdata;
92 port->mem.default_local_map = data;
93 port->mem.default_globl_map = data;
98 _mcs51_setDefaultOptions (void)
103 _mcs51_getRegName (struct regs *reg)
111 _mcs51_genAssemblerPreamble (FILE * of)
115 /* Generate interrupt vector table. */
117 _mcs51_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
122 /** $1 is always the basename.
123 $2 is always the output file.
125 $l is the list of extra options that should be there somewhere...
126 MUST be terminated with a NULL.
128 static const char *_linkCmd[] =
130 "aslink", "-nf", "$1", NULL
133 static const char *_asmCmd[] =
135 "asx8051", "$l", "-plosgffc", "$1.asm", NULL
143 "MCU 8051", /* Target name */
145 TRUE, /* Emit glue around main */
146 MODEL_SMALL | MODEL_LARGE,
151 "-plosgffc", /* Options with debug */
152 "-plosgff", /* Options without debug */
165 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
166 1, 1, 2, 4, 1, 2, 3, 1, 4, 4
188 /* mcs51 has an 8 bit mul */
195 _mcs51_finaliseOptions,
196 _mcs51_setDefaultOptions,
197 mcs51_assignRegisters,
200 _mcs51_genAssemblerPreamble,
202 _mcs51_reset_regparm,
208 1, /* transform <= to ! > */
209 1, /* transform >= to ! < */
210 1, /* transform != to !(a == b) */