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 - POINTER
96 istack = allocMap (0, 1, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',FPOINTER);
100 static void _avr_setDefaultOptions(void)
102 options.stackAuto = 1;
105 static const char *_avr_getRegName(struct regs *reg)
112 static void _avr_genAssemblerPreamble(FILE *of)
117 /* Generate interrupt vector table. */
118 static int _avr_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
123 /** $1 is always the basename.
124 $2 is always the output file.
126 $l is the list of extra options that should be there somewhere...
127 MUST be terminated with a NULL.
129 static const char *_linkCmd[] = {
130 "aslink", "-nf", "$1", NULL
133 static const char *_asmCmd[] = {
134 "asx8051", "-plosgffc", "$1.asm", NULL
140 "ATMEL AVR", /* Target name */
142 TRUE, /* Emit glue around main */
143 MODEL_LARGE | MODEL_SMALL,
148 "-plosgffc", /* Options with debug */
149 "-plosgff", /* Options without debug */
161 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
162 1, 1, 2, 4, 2, 2, 3, 1, 4, 4
184 /* avr has an 8 bit mul */
191 _avr_finaliseOptions,
192 _avr_setDefaultOptions,
196 _avr_genAssemblerPreamble,