ref: d68e26e79e47319e2066434c8d4e18c7a653159a
parent: ad726c612004cf5b648f493c17ac90a0d8b0c05e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Dec 27 09:58:25 EST 2017
[as-z80] Add unconditional absolute branches
--- a/as/target/x80/ins.c
+++ b/as/target/x80/ins.c
@@ -246,15 +246,14 @@
void
imm16(Op *op, Node **args)
{
- Node *par1, *par2;
+ Node *imm;
unsigned char buf[4];
unsigned val;
int n = op->size;
- par2 = args[1];
-
+ imm = (args[1]) ? args[1] : args[0];
memcpy(buf, op->bytes, n);
- val = par2->sym->value;
+ val = imm->sym->value;
buf[n-1] = val >> 8;
buf[n-2] = val;
emit(buf, n);
--- a/as/target/z80/test.s
+++ b/as/target/z80/test.s
@@ -193,7 +193,7 @@
RET %NZ / C0
POP %BC / C1
JP %NZ,16384 / C2 00 40
-/C3 n n JP nn
+ JP 32768 / C3 00 80
CALL %NZ,32768 / C4 00 80
PUSH %BC / C5
ADD %A,32 / C6 20
@@ -458,7 +458,7 @@
SET 7,(%HL) / CB FE
SET 7,%A / CB FF
CALL %Z,16384 / CC 00 40
-/CD n n CALL nn
+ CALL 16384 / CD 00 40
ADC %A,64 / CE 40
RST 8 / CF
RET %NC / D0