a) fixed some aliasing problems
[fw/sdcc] / src / mcs51 / main.c
1 /** @file main.c
2     mcs51 specific general functions.
3
4     Note that mlh prepended _mcs51_ on the static functions.  Makes
5     it easier to set a breakpoint using the debugger.
6 */
7 #include "common.h"
8 #include "main.h"
9 #include "ralloc.h"
10
11 /* list of key words used by msc51 */
12 static char *_mcs51_keywords[] =     {
13     "at",
14     "bit",
15     "code",
16     "critical",
17     "data",
18     "far",
19     "idata",
20     "interrupt",
21     "near",
22     "pdata",
23     "reentrant",
24     "sfr",
25     "sbit",
26     "using",
27     "xdata",
28     "_data",
29     "_code",
30     "_generic",
31     "_near",
32     "_xdata",
33     "_pdata",
34     "_idata",
35     NULL
36 };
37
38
39 void mcs51_assignRegisters (eBBlock **ebbs, int count);
40
41 static bool _mcs51_parseOptions(int *pargc, char **argv)
42 {
43     return FALSE;
44 }
45
46 static void _mcs51_finaliseOptions(void)
47 {
48 }
49
50 static void _mcs51_setDefaultOptions(void)
51 {    
52 }
53
54 static const char *_mcs51_getRegName(struct regs *reg)
55 {
56     if (reg)
57         return reg->name;
58     return "err";
59 }
60
61 /* Globals */
62 PORT mcs51_port = {
63     "mcs51",
64     "MCU 8051",                 /* Target name */
65     {   
66         "asx8051",              /* Assembler executable name */
67         "-plosgffc",            /* Options with debug */
68         "-plosgff",             /* Options without debug */
69         FALSE                   /* TRUE if the assembler requires an output name */
70     },
71     {
72         "aslink",               /* Linker executable name */
73     },
74     {
75         /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
76         1, 1, 2, 4, 1, 2, 3, 1, 4, 4
77     },
78     {
79         "XSEG    (XDATA)",
80         "STACK   (DATA)",
81         "CSEG    (CODE)",
82         "DSEG    (DATA)",
83         "ISEG    (DATA)",
84         "XSEG    (XDATA)",
85         "BSEG    (BIT)",
86         "RSEG    (DATA)",
87         "GSINIT  (CODE)",
88         "OSEG    (OVR,DATA)"
89     },
90     { 
91         +1, 1, 4, 1, 1
92     },
93     /* mcs51 has an 8 bit mul */
94     {
95         1
96     },
97     _mcs51_parseOptions,
98     _mcs51_finaliseOptions,
99     _mcs51_setDefaultOptions,
100     mcs51_assignRegisters,
101     _mcs51_getRegName ,
102     _mcs51_keywords
103
104 };