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_init(void)
42 asm_addTree(&asm_asxxxx_mapping);
45 static void _avr_reset_regparm()
50 static int _avr_regparm( link *l)
52 /* the first eight bytes will be passed in
53 registers r16-r23. but we won't split variables
54 i.e. if not enough registers left to hold
55 the parameter then the whole parameter along
56 with rest of the parameters go onto the stack */
57 if (regParmFlg < 8 ) {
59 if ((size = getSize(l)) > (8 - regParmFlg)) {
60 /* all remaining go on stack */
71 void avr_assignRegisters (eBBlock **ebbs, int count);
73 static bool _avr_parseOptions(int *pargc, char **argv, int *i)
75 /* TODO: allow port-specific command line options to specify
81 static void _avr_finaliseOptions(void)
83 port->mem.default_local_map =
84 port->mem.default_globl_map = xdata;
85 /* change stack to be in far space */
86 /* internal stack segment ;
94 POINTER-TYPE - FPOINTER
96 istack = allocMap (0, 1, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',FPOINTER);
98 /* also change xdata to be direct space since we can use lds/sts */
103 static void _avr_setDefaultOptions(void)
105 options.stackAuto = 1;
108 static const char *_avr_getRegName(struct regs *reg)
115 static void _avr_genAssemblerPreamble(FILE *of)
120 /* Generate interrupt vector table. */
121 static int _avr_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
126 /** $1 is always the basename.
127 $2 is always the output file.
129 $l is the list of extra options that should be there somewhere...
130 MUST be terminated with a NULL.
132 static const char *_linkCmd[] = {
133 "aslink", "-nf", "$1", NULL
136 static const char *_asmCmd[] = {
137 "asx8051", "-plosgffc", "$1.asm", NULL
143 "ATMEL AVR", /* Target name */
145 TRUE, /* Emit glue around main */
146 MODEL_LARGE | MODEL_SMALL,
151 "-plosgffc", /* Options with debug */
152 "-plosgff", /* Options without debug */
164 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
165 1, 1, 2, 4, 2, 2, 3, 1, 4, 4
187 /* avr has an 8 bit mul */
194 _avr_finaliseOptions,
195 _avr_setDefaultOptions,
199 _avr_genAssemblerPreamble,
206 1, /* transform gt ==> not le */