shithub: scc

Download patch

ref: 064827f58bf1e87a4640ebabaa8152878ccb585b
parent: c05751413d4747d97b42659222c336ddeccbbdfa
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Dec 19 03:02:59 EST 2017

[as-z80] Remove r8()

This functionality is done by r8_xx.

--- a/as/target/x80/ins.c
+++ b/as/target/x80/ins.c
@@ -251,15 +251,13 @@
 void
 xx_r8(Op *op, Node **args)
 {
-	Node *par1, *par2;
+	Node *par;
 	unsigned char buf[3];
 	int n = op->size;
 
-	par1 = args[0];
-	par2 = args[1];
-
+	par = args[1];
 	memcpy(buf, op->bytes, n);
-	buf[n-1] |= reg2int(par2->sym->argtype);
+	buf[n-1] |= reg2int(par->sym->argtype);
 	emit(buf, n);
 }
 
@@ -266,15 +264,13 @@
 void
 r8_xx(Op *op, Node **args)
 {
-	Node *par1, *par2;
+	Node *par;
 	unsigned char buf[3];
 	int n = op->size;
 
-	par1 = args[0];
-	par2 = args[1];
-
+	par = args[0];
 	memcpy(buf, op->bytes, n);
-	buf[n-1] |= reg2int(par1->sym->argtype) << 3;
+	buf[n-1] |= reg2int(par->sym->argtype) << 3;
 	emit(buf, n);
 }
 
@@ -316,13 +312,6 @@
 {
 	args[1] = args[1]->left;
 	r16_imm16(op, args);
-}
-
-void
-r8(Op *op, Node **args)
-{
-	/* TODO */
-	abort();
 }
 
 void
--- a/as/target/x80/x80.dat
+++ b/as/target/x80/x80.dat
@@ -170,16 +170,16 @@
 CP	A,(IX+n)	3	0xdd,0xbe	idx	Z80,R800
 CP	A,(IY+n)	3	0xfd,0xbe	idx	Z80,R800
 
-INC	r	1	0x40	r8	Z80,R800,GB80
-INC	p	2	0xdd,0x40	r8	Z80,R800
-INC	q	2	0xfd,0x40	r8	Z80,R800
+INC	r	1	0x40	r8_xx	Z80,R800,GB80
+INC	p	2	0xdd,0x40	r8_xx	Z80,R800
+INC	q	2	0xfd,0x40	r8_xx	Z80,R800
 INC	(HL)	1	0x34	noargs	Z80,R800,GB80
 INC	(IX+n)	3	0xdd,0x34	idx	Z80,R800
 INC	(IY+n)	3	0xfd,0x34	idx	Z80,R800
 
-DEC	r	1	0x05	r8	Z80,R800,GB80
-DEC	p	2	0xdd,0x05	r8	Z80,R800
-DEC	q	2	0xfd,0x05	r8	Z80,R800
+DEC	r	1	0x05	r8_xx	Z80,R800,GB80
+DEC	p	2	0xdd,0x05	r8_xx	Z80,R800
+DEC	q	2	0xfd,0x05	r8_xx	Z80,R800
 DEC	(HL)	1	0x35	noargs	Z80,R800,GB80
 DEC	(IX+n)	3	0xdd,0x35	idx	Z80,R800
 DEC	(IY+n)	3	0xfd,0x35	idx	Z80,R800
@@ -238,7 +238,7 @@
 RLD	none	2	0xed,0x6f	noargs	Z80,R800
 RRD	none	2	0xed,0x67	noargs	Z80,R800
 
-RLC	r	2	0xcb,0x00	r8	Z80,R800
+RLC	r	2	0xcb,0x00	r8_xx	Z80,R800
 RLC	(HL)	2	0xcb,0x06	noargs	Z80,R800
 RLC	(IX+n)	4	0xdd,0xcb,0x06	idx	Z80,R800
 RLC	(IY+n)	4	0xfd,0xcb,0x06	idx	Z80,R800
@@ -245,7 +245,7 @@
 RLC	(IX+n),r	4	0xdd,0xcb,0,0x00	idx_r8	Z80,R800
 RLC	(IY+n),r	4	0xfd,0xcb,0,0x00	idx_r8	Z80,R800
 
-RL	r	2	0xcb,0x10	r8	Z80,R800
+RL	r	2	0xcb,0x10	r8_xx	Z80,R800
 RL	(HL)	2	0xcb,0x16	noargs	Z80,R800
 RL	(IX+n)	4	0xdd,0xcb,0x16	idx	Z80,R800
 RL	(IY+n)	4	0xfd,0xcb,0x16	idx	Z80,R800
@@ -252,7 +252,7 @@
 RL	(IX+n),r	4	0xdd,0xcb,0,0x10	idx_r8	Z80,R800
 RL	(IY+n),r	4	0xfd,0xcb,0,0x10	idx_r8	Z80,R800
 
-RRC	r	2	0xcb,0x08	r8	Z80,R800
+RRC	r	2	0xcb,0x08	r8_xx	Z80,R800
 RRC	(HL)	2	0xcb,0x06	noargs	Z80,R800
 RRC	(IX+n)	4	0xdd,0xcb,0x06	idx	Z80,R800
 RRC	(IY+n)	4	0xfd,0xcb,0x06	idx	Z80,R800
@@ -259,7 +259,7 @@
 RRC	(IX+n),r	4	0xdd,0xcb,0,0x08	idx_r8	Z80,R800
 RRC	(IY+n),r	4	0xfd,0xcb,0,0x08	idx_r8	Z80,R800
 
-RR	r	2	0xcb,0x18	r8	Z80,R800
+RR	r	2	0xcb,0x18	r8_xx	Z80,R800
 RR	(HL)	2	0xcb,0x1e	noargs	Z80,R800
 RR	(IX+n)	4	0xdd,0xcb,0x1e	idx	Z80,R800
 RR	(IY+n)	4	0xfd,0xcb,0x1e	idx	Z80,R800
@@ -266,7 +266,7 @@
 RR	(IX+n),r	4	0xdd,0xcb,0,0x18	idx_r8	Z80,R800
 RR	(IY+n),r	4	0xfd,0xcb,0,0x18	idx_r8	Z80,R800
 
-SLA	r	2	0xcb,0x20	r8	Z80,R800
+SLA	r	2	0xcb,0x20	r8_xx	Z80,R800
 SLA	(HL)	2	0xcb,0x26	noargs	Z80,R800
 SLA	(IX+n)	4	0xdd,0xcb,0x26	idx	Z80,R800
 SLA	(IY+n)	4	0xfd,0xcb,0x26	idx	Z80,R800
@@ -273,7 +273,7 @@
 SLA	(IX+n),r	4	0xdd,0xcb,0,0x20	idx_r8	Z80,R800
 SLA	(IY+n),r	4	0xfd,0xcb,0,0x20	idx_r8	Z80,R800
 
-SLL	r	2	0xcb,0x30	r8	Z80
+SLL	r	2	0xcb,0x30	r8_xx	Z80
 SLL	(HL)	2	0xcb,0x36	noargs	Z80
 SLL	(IX+n)	4	0xdd,0xcb,0x36	idx	Z80
 SLL	(IY+n)	4	0xfd,0xcb,0x36	idx	Z80
@@ -280,7 +280,7 @@
 SLL	(IX+n),r	4	0xdd,0xcb,0,0x30	idx_r8	Z80
 SLL	(IY+n),r	4	0xfd,0xcb,0,0x30	idx_r8	Z80
 
-SRA	r	2	0xcb,0x28	r8	Z80,R800
+SRA	r	2	0xcb,0x28	r8_xx	Z80,R800
 SRA	(HL)	2	0xcb,0x2e	noargs	Z80,R800
 SRA	(IX+n)	4	0xdd,0xcb,0x2e	idx	Z80,R800
 SRA	(IY+n)	4	0xfd,0xcb,0x2e	idx	Z80,R800
@@ -287,7 +287,7 @@
 SRA	(IX+n),r	4	0xdd,0xcb,0,0x28	idx_r8	Z80,R800
 SRA	(IY+n),r	4	0xfd,0xcb,0,0x28	idx_r8	Z80,R800
 
-SRL	r	2	0xcb,0x38	r8	Z80,R800
+SRL	r	2	0xcb,0x38	r8_xx	Z80,R800
 SRL	(HL)	2	0xcb,0x3e	noargs	Z80,R800
 SRL	(IX+n)	4	0xdd,0xcb,0x3e	idx	Z80,R800
 SRL	(IY+n)	4	0xfd,0xcb,0x3e	idx	Z80,R800