1 /** @file izt/tlcs900h.c
2 tlcs900h specific general functions.
6 static REG _tlcs900h_regs[] = {
7 { 1, REG_ID_C, "c", 0, { REG_ID_BC, REG_ID_NONE, REG_ID_NONE } },
8 { 1, REG_ID_B, "b", 0, { REG_ID_BC, REG_ID_NONE, REG_ID_NONE } },
9 { 1, REG_ID_E, "e", 0, { REG_ID_DE, REG_ID_NONE, REG_ID_NONE } },
10 { 1, REG_ID_D, "d", 0, { REG_ID_DE, REG_ID_NONE, REG_ID_NONE } },
11 { 2, REG_ID_BC, "bc", 0, { REG_ID_C, REG_ID_B, REG_ID_NONE } },
12 { 2, REG_ID_DE, "de", 0, { REG_ID_E, REG_ID_D, REG_ID_NONE } },
13 { 4, REG_ID_XBC, "xbc", 0, { REG_ID_C, REG_ID_B, REG_ID_BC } },
14 { 4, REG_ID_XDE, "xde", 0, { REG_ID_E, REG_ID_D, REG_ID_DE } },
15 { 0, REG_ID_NONE,"??", 0, { REG_ID_NONE, REG_ID_NONE, REG_ID_NONE } }
18 static IZT_PORT _tlcs900h_port = {
22 static char _defaultRules[] =
24 //#include "peeph.rul"
27 static char *_tlcs900h_keywords[] = {
31 void tlcs900h_assignRegisters (eBBlock **ebbs, int count);
33 static void _tlcs900h_init(void)
35 asm_addTree(&asm_asxxxx_mapping);
36 izt_init(&_tlcs900h_port);
39 static void _tlcs900h_reset_regparm()
43 static int _tlcs900h_regparm( sym_link *l)
45 // PENDING: No register parameters.
49 static bool _tlcs900h_parseOptions(int *pargc, char **argv, int *i)
51 /* TODO: allow port-specific command line options to specify
57 static void _tlcs900h_finaliseOptions(void)
62 static void _tlcs900h_setDefaultOptions(void)
67 static const char *_tlcs900h_getRegName(struct regs *reg)
75 static void _tlcs900h_genAssemblerPreamble(FILE *of)
80 /* Generate interrupt vector table. */
81 static int _tlcs900h_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
87 /** $1 is always the basename.
88 $2 is always the output file.
90 $l is the list of extra options that should be there somewhere...
91 MUST be terminated with a NULL.
94 static const char *_linkCmd[] = {
95 "aslink", "-nf", "$1", NULL
99 static const char *_asmCmd[] = {
100 "gpasm", NULL, NULL, NULL
103 void tlcs900h_assignRegisters (eBBlock **ebbs, int count)
108 PORT tlcs900h_port = {
110 "Toshiba TLCS-900H", /* Target name */
112 TRUE, /* Emit glue around main */
131 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
132 1, 2, 2, 4, 2, 2, 2, 1, 4, 4
154 /* tlcs900h has an 16 bit mul */
160 _tlcs900h_parseOptions,
161 _tlcs900h_finaliseOptions,
162 _tlcs900h_setDefaultOptions,
163 tlcs900h_assignRegisters,
164 _tlcs900h_getRegName ,
166 _tlcs900h_genAssemblerPreamble,
168 _tlcs900h_reset_regparm,
174 1, /* transform <= to ! > */
175 1, /* transform >= to ! < */
176 1, /* transform != to !(a == b) */