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);
45 _avr_reset_regparm (void)
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 (ebbIndex *);
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 /* Indicate which extended bit operations this port supports */
136 hasExtBitOp (int op, int size)
147 /* Indicate the expense of an access to an output storage class */
149 oclsExpense (struct memmap *oclass)
151 if (IN_FARSPACE(oclass))
157 /** $1 is always the basename.
158 $2 is always the output file.
160 $l is the list of extra options that should be there somewhere...
161 MUST be terminated with a NULL.
163 static const char *_linkCmd[] = {
164 "linkavr", "", "\"$1\"", NULL
167 /* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */
168 static const char *_asmCmd[] = {
169 "asavr", "$l" , "$3", "\"$1.s\"", NULL
176 "ATMEL AVR", /* Target name */
177 NULL, /* processor */
180 TRUE, /* Emit glue around main */
181 MODEL_LARGE | MODEL_SMALL,
187 "-plosgff", /* Options with debug */
188 "-plosgff", /* Options without debug */
191 NULL, /* no do_assemble */
202 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
203 1, 2, 2, 4, 2, 2, 3, 1, 4, 4},
218 NULL, // initialized xdata
219 NULL, // a code copy of xiseg
227 /* avr has an 8 bit mul */
232 avr_emitDebuggerSymbol
235 255/3, /* maxCount */
236 3, /* sizeofElement */
237 /* The rest of these costs are bogus. They approximate */
238 /* the behavior of src/SDCCicode.c 1.207 and earlier. */
239 {4,4,4}, /* sizeofMatchJump[] */
240 {0,0,0}, /* sizeofRangeCompare[] */
241 0, /* sizeofSubtract */
242 3, /* sizeofDispatch */
249 _avr_finaliseOptions,
250 _avr_setDefaultOptions,
254 _avr_genAssemblerPreamble,
255 NULL, /* no genAssemblerEnd */
257 NULL, // _avr_genXINIT
258 NULL, /* genInitStartup */
264 hasExtBitOp, /* hasExtBitOp */
265 oclsExpense, /* oclsExpense */
267 TRUE, /* little endian */
269 1, /* transform gt ==> not le */
274 FALSE, /* No array initializer support. */
275 0, /* no CSE cost estimation yet */
276 NULL, /* no builtin functions */
277 GPOINTER, /* treat unqualified pointers as "generic" pointers */
278 1, /* reset labelKey to 1 */
279 1, /* globals & local static allowed */