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[] = {
37 static int regParmFlg = 0; /* determine if we can register a parameter */
39 static void _avr_init(void)
41 asm_addTree(&asm_asxxxx_mapping);
44 static void _avr_reset_regparm()
49 static int _avr_regparm( sym_link *l)
51 /* the first eight bytes will be passed in
52 registers r16-r23. but we won't split variables
53 i.e. if not enough registers left to hold
54 the parameter then the whole parameter along
55 with rest of the parameters go onto the stack */
56 if (regParmFlg < 8 ) {
58 if ((size = getSize(l)) > (8 - regParmFlg)) {
59 /* all remaining go on stack */
70 void avr_assignRegisters (eBBlock **ebbs, int count);
72 static bool _avr_parseOptions(int *pargc, char **argv, int *i)
74 /* TODO: allow port-specific command line options to specify
80 static void _avr_finaliseOptions(void)
82 port->mem.default_local_map =
83 port->mem.default_globl_map = xdata;
84 /* change stack to be in far space */
85 /* internal stack segment ;
93 POINTER-TYPE - FPOINTER
95 istack = allocMap (0, 1, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',FPOINTER);
97 /* also change xdata to be direct space since we can use lds/sts */
102 static void _avr_setDefaultOptions(void)
104 options.stackAuto = 1;
107 static const char *_avr_getRegName(struct regs *reg)
114 static void _avr_genAssemblerPreamble(FILE *of)
119 /* Generate interrupt vector table. */
120 static int _avr_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
125 /** $1 is always the basename.
126 $2 is always the output file.
128 $l is the list of extra options that should be there somewhere...
129 MUST be terminated with a NULL.
131 static const char *_linkCmd[] = {
132 "aslink", "-nf", "$1", NULL
135 static const char *_asmCmd[] = {
136 "asx8051", "-plosgffc", "$1.asm", NULL
142 "ATMEL AVR", /* Target name */
144 TRUE, /* Emit glue around main */
145 MODEL_LARGE | MODEL_SMALL,
150 "-plosgffc", /* Options with debug */
151 "-plosgff", /* Options without debug */
163 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
164 1, 1, 2, 4, 2, 2, 3, 1, 4, 4
186 /* avr has an 8 bit mul */
193 _avr_finaliseOptions,
194 _avr_setDefaultOptions,
198 _avr_genAssemblerPreamble,
205 1, /* transform gt ==> not le */