shithub: scc

Download patch

ref: a50b052c5182c502499380acc3ebaa2cd4aaacbb
parent: 8b6a2d7d21c67db8b1fbc4eaabf3496bcc07941d
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Dec 17 15:04:01 EST 2017

[as-z80] Add load inmmediate with indexed addressing

--- a/as/target/x80/ins.c
+++ b/as/target/x80/ins.c
@@ -152,6 +152,22 @@
 }
 
 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;
--- a/as/target/x80/x80.dat
+++ b/as/target/x80/x80.dat
@@ -94,6 +94,10 @@
 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