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[] = {
34 static int regParmFlg = 0; /* determine if we can register a parameter */
36 static void _avr_reset_regparm()
41 static int _avr_regparm( link *l)
43 /* the first eight bytes will be passed in
44 registers r0-r7. but we won't split variables
45 i.e. if not enough registers left to hold
46 the parameter then the whole parameter along
47 with rest of the parameters go onto the stack */
48 if (regParmFlg < 8 ) {
50 if ((size = getSize(l)) > (8 - regParmFlg)) {
51 /* all remaining go on stack */
62 void avr_assignRegisters (eBBlock **ebbs, int count);
64 static bool _avr_parseOptions(int *pargc, char **argv, int *i)
66 /* TODO: allow port-specific command line options to specify
72 static void _avr_finaliseOptions(void)
74 port->mem.default_local_map =
75 port->mem.default_globl_map = xdata;
76 /* change stack to be in far space */
77 /* internal stack segment ;
85 POINTER-TYPE - POINTER
87 istack = allocMap (0, 1, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',FPOINTER);
91 static void _avr_setDefaultOptions(void)
93 options.stackAuto = 1;
96 static const char *_avr_getRegName(struct regs *reg)
103 static void _avr_genAssemblerPreamble(FILE *of)
108 /* Generate interrupt vector table. */
109 static int _avr_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
114 /** $1 is always the basename.
115 $2 is always the output file.
117 $l is the list of extra options that should be there somewhere...
118 MUST be terminated with a NULL.
120 static const char *_linkCmd[] = {
121 "aslink", "-nf", "$1", NULL
124 static const char *_asmCmd[] = {
125 "asx8051", "-plosgffc", "$1.asm", NULL
131 "ATMEL AVR", /* Target name */
133 TRUE, /* Emit glue around main */
137 "-plosgffc", /* Options with debug */
138 "-plosgff", /* Options without debug */
147 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
148 1, 1, 2, 4, 2, 2, 3, 1, 4, 4
168 /* avr has an 8 bit mul */
174 _avr_finaliseOptions,
175 _avr_setDefaultOptions,
179 _avr_genAssemblerPreamble,