a5e4697fe14f46029bc78d04c11580e51f4d3e1f
[fw/sdcc] / src / z80 / main.c
1 #include "common.h"
2 #include "ralloc.h"
3
4 static char *_z80_keywords[] = { NULL };
5
6 void z80_assignRegisters (eBBlock **ebbs, int count);
7
8 static bool _z80_parseOptions(int *pargc, char **argv)
9 {
10     return FALSE;
11 }
12
13 static void _z80_finaliseOptions(void)
14 {
15 }
16
17 static void _z80_setDefaultOptions(void)
18 {    
19     options.genericPtr = 1;   /* default on */
20     options.nopeep    = 1;
21     options.stackAuto = 1;
22     options.mainreturn = 1;
23     options.noregparms = 1;
24     /* first the options part */
25     options.intlong_rent = 1;
26
27     optimize.global_cse = 0;    
28     optimize.label1 = 0;
29     optimize.label2 = 0;
30     optimize.label3 = 0;
31     optimize.label4 = 0;    
32     optimize.loopInvariant = 0;
33     optimize.loopInduction = 0;
34 }
35
36 static const char *_z80_getRegName(struct regs *reg)
37 {
38     if (reg)
39         return reg->name;
40     return "err";
41 }
42
43 /* Globals */
44 PORT z80_port = {
45     "z80",
46     "Zilog Z80",                /* Target name */
47     {   
48         "as-z80",               /* Assembler executable name */
49         "-plosgff",             /* Options with debug */
50         "-plosgff",             /* Options without debug */
51         TRUE                    /* TRUE if the assembler requires an output name */
52     },
53     {
54         "link-z80",             /* Linker executable name */
55     },
56     {
57         /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
58         1, 1, 2, 4, 2, 2, 2, 1, 4, 4
59     },
60     {
61         "_XSEG",
62         "_STACK",
63         "_CODE",
64         "_DATA",
65         "_ISEG",
66         "_XSEG",
67         "_BSEG",
68         "_RSEG",
69         "_GSINIT",
70         "_OVERLAY"
71     },
72     { 
73         -1, 0, 0, 8, 0
74     },
75     /* Z80 has no native mul/div commands */
76     {  
77         0
78     },
79     _z80_parseOptions,
80     _z80_finaliseOptions,
81     _z80_setDefaultOptions,
82     z80_assignRegisters,
83     _z80_getRegName,
84     _z80_keywords
85 };
86