{ "immedword", "#0x%04X" },
{ "immedbyte", "#0x%02X" },
{ "hashedstr", "#%s" },
- { "lsbimmeds", "#<%s" },
- { "msbimmeds", "#>%s" },
+ { "lsbimmeds", "#>%s" },
+ { "msbimmeds", "#<%s" },
{ "module", ".module %s" },
{ "global", ".globl %s" },
{ "fileprelude", "" },
case AOP_IMMD:
/* PENDING: for re-target */
if (with_hash)
- tsprintf(s, "!hashed", aop->aopu.aop_immd);
+ tsprintf(s, "!hashedstr", aop->aopu.aop_immd);
else
strcpy(s, aop->aopu.aop_immd);
ALLOC_ATOMIC(rs,strlen(s)+1);
case AOP_HL:
wassert(IS_GB);
/* PENDING: for re-target */
- if (!strcmp(s, "!*hl")) {
+ if (!strcmp(s, "!*hl") || !strcmp(s, "(hl)") || !strcmp(s, "[hl]")) {
emit2("ld a,!*hl");
s = "a";
}
case AOP_STK:
if (IS_GB) {
/* PENDING: re-target */
- if (!strcmp("!*hl", s)) {
+ if (!strcmp(s, "!*hl") || !strcmp(s, "(hl)") || !strcmp(s, "[hl]")) {
emit2("ld a,!*hl");
s = "a";
}
_G.stack.pushed += 2;
fetchHL(AOP(IC_LEFT(ic)));
- emit2("jp", "!*hl");
+ emit2("jp !*hl");
emit2("!tlabeldef", (rlbl->key+100));
_G.stack.pushed -= 2;
}
nregssaved = 0;
/* create the function header */
emit2("!functionheader", sym->name);
+ /* PENDING: portability. */
+ emit2("__%s_start:", sym->rname);
emit2("!functionlabeldef", sym->rname);
fetype = getSpec(operandType(IC_LEFT(ic)));
emit2("!leavex", _G.stack.offset);
else
emit2("!leave");
+ /* PENDING: portability. */
+ emit2("__%s_end:", sym->rname);
}
_G.stack.pushed = 0;
_G.stack.offset = 0;
wassert(0);
}
else {
- MOVA(aopGet(AOP(right),offset,FALSE));
- emitcode("and","%s,a",
- aopGet(AOP(left),offset,FALSE));
+ MOVA(aopGet(AOP(left),offset,FALSE));
+ emitcode("and","a,%s",
+ aopGet(AOP(right),offset,FALSE));
+ emitcode("ld", "%s,a", aopGet(AOP(left),offset,FALSE));
}
}
}
static void _gbz80_init(void)
{
z80_opts.sub = SUB_GBZ80;
- asm_addTree(&_rgbds_gb);
+ asm_addTree(&_asxxxx_gb);
}
static int regParmFlg = 0; /* determine if we can register a parameter */
1, 1, 2, 4, 2, 2, 2, 1, 4, 4
},
{
- "XSEG",
- "STACK",
- "CODE",
- "DATA",
- "ISEG",
- "XSEG",
- "BSEG",
- "RSEG",
- "GSINIT",
- "OVERLAY",
- "GSFINAL",
+ "_XSEG",
+ "_STACK",
+ "_CODE",
+ "_DATA",
+ "_ISEG",
+ "_XSEG",
+ "_BSEG",
+ "_RSEG",
+ "_GSINIT",
+ "_OVERLAY",
+ "_GSFINAL",
NULL,
NULL,
1
1, 1, 2, 4, 2, 2, 2, 1, 4, 4
},
{
- "XSEG",
- "STACK",
- "CODE",
- "DATA",
- "ISEG",
- "XSEG",
- "BSEG",
- "RSEG",
- "GSINIT",
- "OVERLAY",
- "GSFINAL",
+ "_XSEG",
+ "_STACK",
+ "_CODE",
+ "_DATA",
+ "_ISEG",
+ "_XSEG",
+ "_BSEG",
+ "_RSEG",
+ "_GSINIT",
+ "_OVERLAY",
+ "_GSFINAL",
NULL,
NULL,
1