2 avr specific general functions.
4 Note that mlh prepended _avr_ 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 *_avr_keywords[] = {
38 static int regParmFlg = 0; /* determine if we can register a parameter */
40 static void _avr_reset_regparm()
45 static int _avr_regparm( link *l)
47 /* the first eight bytes will be passed in
48 registers r16-r23. but we won't split variables
49 i.e. if not enough registers left to hold
50 the parameter then the whole parameter along
51 with rest of the parameters go onto the stack */
52 if (regParmFlg < 8 ) {
54 if ((size = getSize(l)) > (8 - regParmFlg)) {
55 /* all remaining go on stack */
66 void avr_assignRegisters (eBBlock **ebbs, int count);
68 static bool _avr_parseOptions(int *pargc, char **argv, int *i)
70 /* TODO: allow port-specific command line options to specify
76 static void _avr_finaliseOptions(void)
78 port->mem.default_local_map =
79 port->mem.default_globl_map = xdata;
80 /* change stack to be in far space */
81 /* internal stack segment ;
89 POINTER-TYPE - POINTER
91 istack = allocMap (0, 1, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',FPOINTER);
95 static void _avr_setDefaultOptions(void)
97 options.stackAuto = 1;
100 static const char *_avr_getRegName(struct regs *reg)
107 static void _avr_genAssemblerPreamble(FILE *of)
112 /* Generate interrupt vector table. */
113 static int _avr_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
118 /** $1 is always the basename.
119 $2 is always the output file.
121 $l is the list of extra options that should be there somewhere...
122 MUST be terminated with a NULL.
124 static const char *_linkCmd[] = {
125 "aslink", "-nf", "$1", NULL
128 static const char *_asmCmd[] = {
129 "asx8051", "-plosgffc", "$1.asm", NULL
135 "ATMEL AVR", /* Target name */
137 TRUE, /* Emit glue around main */
141 "-plosgffc", /* Options with debug */
142 "-plosgff", /* Options without debug */
151 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
152 1, 1, 2, 4, 2, 2, 3, 1, 4, 4
173 /* avr has an 8 bit mul */
179 _avr_finaliseOptions,
180 _avr_setDefaultOptions,
184 _avr_genAssemblerPreamble,