X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fizt%2Fi186.c;h=16b539ad629df3761aa189a1dc7c41489b83d7fd;hb=8b194ce521ec1d8a69f019f1b286a0a1c8ff2343;hp=c11a5b8aa366f1223d861295b70629ed5fd72840;hpb=899ee91ab8169609f83f2c34c14d9112df2bb085;p=fw%2Fsdcc diff --git a/src/izt/i186.c b/src/izt/i186.c index c11a5b8a..16b539ad 100644 --- a/src/izt/i186.c +++ b/src/izt/i186.c @@ -13,6 +13,10 @@ static REG _i186_regs[] = { { 0, REG_ID_NONE,"??", 0, { REG_ID_NONE, REG_ID_NONE, REG_ID_NONE } } }; +static IZT_PORT _i186_port = { + _i186_regs +}; + static char _defaultRules[] = { //#include "peeph.rul" @@ -23,10 +27,67 @@ static char *_i186_keywords[] = { NULL }; +// PENDING: A default set of mappings to make asm.c happy. +static const ASM_MAPPING _asxxxx_z80_mapping[] = { + /* We want to prepend the _ */ + { "area", ".area _%s" }, + { "areacode", ".area _%s" }, + { "areadata", ".area _%s" }, + { "areahome", ".area _%s" }, + { "*ixx", "%d(ix)" }, + { "*iyx", "%d(iy)" }, + { "*hl", "(hl)" }, + { "di", "di" }, + { "ldahli", + "ld a,(hl)\n" + "\tinc\thl" }, + { "ldahlsp", + "ld hl,#%d\n" + "\tadd\thl,sp" }, + { "ldaspsp", + "ld hl,#%d\n" + "\tadd\thl,sp\n" + "\tld\tsp,hl" }, + { "*pair", "(%s)" }, + { "shortjp", "jp" }, + { "enter", + "push\tix\n" + "\tld\tix,#0\n" + "\tadd\tix,sp" }, + { "enterx", + "push\tix\n" + "\tld\tix,#0\n" + "\tadd\tix,sp\n" + "\tld\thl,#-%d\n" + "\tadd\thl,sp\n" + "\tld\tsp,hl" }, + { "leave", + "pop\tix\n" + }, + { "leavex", + "ld sp,ix\n" + "\tpop\tix\n" + }, + { "pusha", + "push af\n" + "\tpush\tbc\n" + "\tpush\tde\n" + "\tpush\thl" + }, + { "adjustsp", "lda sp,-%d(sp)" }, + { NULL, NULL } +}; + +static const ASM_MAPPINGS _asxxxx_z80 = { + &asm_asxxxx_mapping, + _asxxxx_z80_mapping +}; + static void _i186_init(void) { asm_addTree(&asm_asxxxx_mapping); - izt_init(_i186_regs); + asm_addTree(&_asxxxx_z80); + izt_init(&_i186_port); } static void _i186_reset_regparm()