scc

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

commit 6847ff0a060948214fd8b197436f16cc0c5579db
parent e082f4ab7ab853d303e2b6cd329aabbfb0493b1a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 17 Dec 2017 20:04:01 +0100

[as-z80] Add load inmmediate with indexed addressing

Diffstat:
Mas/target/x80/ins.c | 16++++++++++++++++
Mas/target/x80/x80.dat | 4++++
2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/as/target/x80/ins.c b/as/target/x80/ins.c @@ -152,6 +152,22 @@ idx_r8(Op *op, Node **args) } void +idx_imm8(Op *op, Node **args) +{ + Node *par1, *par2; + unsigned char buf[3]; + int n = op->size; + + par1 = args[0]->left; + par2 = args[1]; + + memcpy(buf, op->bytes, n-1); + buf[n-1] = par1->sym->value; + buf[n-2] = par2->sym->value; + emit(buf, n); +} + +void imm8(Op *op, Node **args) { Node *par1, *par2; diff --git a/as/target/x80/x80.dat b/as/target/x80/x80.dat @@ -94,6 +94,10 @@ LD reg_r,idx_IY 3 0xfd,0x46 r8_idx Z80,R800 LD idx_IX,reg_r 3 0xdd,0x70 idx_r8 Z80,R800 LD idx_IY,reg_r 3 0xfd,0x70 idx_r8 Z80,R800 +LD indir_HL,imm8 2 0x36 imm8 Z80,R800,GB80 +LD idx_IX,imm8 3 0xdd,0x36 idx_imm8 Z80,R800 +LD idx_IY,imm8 3 0xfd,0x36 idx_imm8 Z80,R800 + # 16 bit load group LD reg_dd,imm16 3 0x01 r16_imm16 Z80,R800,GB80 LD regIX,imm16 4 0xdd,0x21 imm16 Z80,R800