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 char _defaultRules[] =
20 //#include "peeph.rul"
23 /* list of key words used by msc51 */
24 static char *_tlcs900h_keywords[] = {
28 void tlcs900h_assignRegisters (eBBlock **ebbs, int count);
30 static void _tlcs900h_init(void)
32 asm_addTree(&asm_asxxxx_mapping);
35 static void _tlcs900h_reset_regparm()
39 static int _tlcs900h_regparm( sym_link *l)
41 // PENDING: No register parameters.
45 static bool _tlcs900h_parseOptions(int *pargc, char **argv, int *i)
47 /* TODO: allow port-specific command line options to specify
53 static void _tlcs900h_finaliseOptions(void)
58 static void _tlcs900h_setDefaultOptions(void)
63 static const char *_tlcs900h_getRegName(struct regs *reg)
71 static void _tlcs900h_genAssemblerPreamble(FILE *of)
76 /* Generate interrupt vector table. */
77 static int _tlcs900h_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
83 /** $1 is always the basename.
84 $2 is always the output file.
86 $l is the list of extra options that should be there somewhere...
87 MUST be terminated with a NULL.
90 static const char *_linkCmd[] = {
91 "aslink", "-nf", "$1", NULL
95 static const char *_asmCmd[] = {
96 "gpasm", NULL, NULL, NULL
99 void tlcs900h_assignRegisters (eBBlock **ebbs, int count)
104 PORT tlcs900h_port = {
106 "Toshiba TLCS-900H", /* Target name */
108 TRUE, /* Emit glue around main */
127 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
128 1, 2, 2, 4, 2, 2, 2, 1, 4, 4
150 /* tlcs900h has an 16 bit mul */
156 _tlcs900h_parseOptions,
157 _tlcs900h_finaliseOptions,
158 _tlcs900h_setDefaultOptions,
159 tlcs900h_assignRegisters,
160 _tlcs900h_getRegName ,
162 _tlcs900h_genAssemblerPreamble,
164 _tlcs900h_reset_regparm,
170 1, /* transform <= to ! > */
171 1, /* transform >= to ! < */
172 1, /* transform != to !(a == b) */