scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 88b8a82682695a681ca6f9af5367addecf397ca5
parent e18347bdd82976eea49e4ea9d8d1330a2029b28e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 27 Dec 2017 14:58:25 +0000

[as-z80] Add unconditional absolute branches

Diffstat:
Mas/target/x80/ins.c | 7+++----
Mas/target/z80/test.s | 4++--
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/as/target/x80/ins.c b/as/target/x80/ins.c @@ -246,15 +246,14 @@ imm8(Op *op, Node **args) 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); diff --git 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