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[] = {
16 /* list of key words used by msc51 */
17 static char *_avr_keywords[] = {
36 static int regParmFlg = 0; /* determine if we can register a parameter */
41 asm_addTree (&asm_asxxxx_mapping);
51 _avr_regparm (sym_link * l)
53 /* the first eight bytes will be passed in
54 registers r16-r23. but we won't split variables
55 i.e. if not enough registers left to hold
56 the parameter then the whole parameter along
57 with rest of the parameters go onto the stack */
60 if ((size = getSize (l)) > (8 - regParmFlg)) {
61 /* all remaining go on stack */
72 void avr_assignRegisters (eBBlock ** ebbs, int count);
75 _avr_parseOptions (int *pargc, char **argv, int *i)
77 /* TODO: allow port-specific command line options to specify
84 _avr_finaliseOptions (void)
86 port->mem.default_local_map = port->mem.default_globl_map = xdata;
87 /* change stack to be in far space */
88 /* internal stack segment ;
96 POINTER-TYPE - FPOINTER
99 allocMap (0, 1, 0, 0, 0, 0, options.stack_loc, ISTACK_NAME,
102 /* also change xdata to be direct space since we can use lds/sts */
108 _avr_setDefaultOptions (void)
110 options.stackAuto = 1;
114 _avr_getRegName (struct regs *reg)
122 _avr_genAssemblerPreamble (FILE * of)
127 /* Generate interrupt vector table. */
129 _avr_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
134 /** $1 is always the basename.
135 $2 is always the output file.
137 $l is the list of extra options that should be there somewhere...
138 MUST be terminated with a NULL.
140 static const char *_linkCmd[] = {
141 "linkavr", "", "$1", NULL
144 /* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */
145 static const char *_asmCmd[] = {
146 "asavr", "$l" , "$3", "$1.s", NULL
153 "ATMEL AVR", /* Target name */
155 TRUE, /* Emit glue around main */
156 MODEL_LARGE | MODEL_SMALL,
161 "-plosgff", /* Options with debug */
162 "-plosgff", /* Options without debug */
173 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
174 1, 2, 2, 4, 2, 2, 3, 1, 4, 4},
194 /* avr has an 8 bit mul */
201 _avr_finaliseOptions,
202 _avr_setDefaultOptions,
206 _avr_genAssemblerPreamble,
214 1, /* transform gt ==> not le */
219 FALSE, /* No array initializer support. */