2 i186 specific general functions.
6 static REG _i186_regs[] = {
7 { 1, REG_ID_CL, "cl", 0, { REG_ID_CX, REG_ID_NONE, REG_ID_NONE } },
8 { 1, REG_ID_CH, "ch", 0, { REG_ID_CX, REG_ID_NONE, REG_ID_NONE } },
9 { 1, REG_ID_DL, "dl", 0, { REG_ID_DX, REG_ID_NONE, REG_ID_NONE } },
10 { 1, REG_ID_DH, "dh", 0, { REG_ID_DX, REG_ID_NONE, REG_ID_NONE } },
11 { 2, REG_ID_CX, "cx", 0, { REG_ID_CL, REG_ID_CH, REG_ID_NONE } },
12 { 2, REG_ID_DX, "dx", 0, { REG_ID_DL, REG_ID_DH, REG_ID_NONE } },
13 { 0, REG_ID_NONE,"??", 0, { REG_ID_NONE, REG_ID_NONE, REG_ID_NONE } }
16 static IZT_PORT _i186_port = {
20 static char _defaultRules[] =
22 //#include "peeph.rul"
25 /* list of key words used by i186 */
26 static char *_i186_keywords[] = {
30 // PENDING: A default set of mappings to make asm.c happy.
31 static const ASM_MAPPING _asxxxx_z80_mapping[] = {
32 /* We want to prepend the _ */
33 { "area", ".area _%s" },
34 { "areacode", ".area _%s" },
35 { "areadata", ".area _%s" },
36 { "areahome", ".area _%s" },
77 { "adjustsp", "lda sp,-%d(sp)" },
81 static const ASM_MAPPINGS _asxxxx_z80 = {
86 static void _i186_init(void)
88 asm_addTree(&asm_asxxxx_mapping);
89 asm_addTree(&_asxxxx_z80);
90 izt_init(&_i186_port);
93 static void _i186_reset_regparm()
97 static int _i186_regparm( sym_link *l)
99 // PENDING: No register parameters.
103 static bool _i186_parseOptions(int *pargc, char **argv, int *i)
105 /* TODO: allow port-specific command line options to specify
106 * segment names here.
111 static void _i186_finaliseOptions(void)
116 static void _i186_setDefaultOptions(void)
121 static const char *_i186_getRegName(struct regs *reg)
129 static void _i186_genAssemblerPreamble(FILE *of)
134 /* Generate interrupt vector table. */
135 static int _i186_genIVT(FILE *of, symbol **interrupts, int maxInterrupts)
141 /** $1 is always the basename.
142 $2 is always the output file.
144 $l is the list of extra options that should be there somewhere...
145 MUST be terminated with a NULL.
148 static const char *_linkCmd[] = {
149 "aslink", "-nf", "$1", NULL
153 static const char *_asmCmd[] = {
154 "gpasm", NULL, NULL, NULL
157 void i186_assignRegisters (eBBlock **ebbs, int count)
164 "Intel 8086/80186", /* Target name */
166 FALSE, /* Emit glue around main */
185 /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
186 1, 2, 2, 4, 2, 2, 2, 1, 4, 4
208 /* i186 has an 16 bit mul */
215 _i186_finaliseOptions,
216 _i186_setDefaultOptions,
220 _i186_genAssemblerPreamble,
228 1, /* transform <= to ! > */
229 1, /* transform >= to ! < */
230 1, /* transform != to !(a == b) */