scc

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

commit 40ac32e5ac6e9caeda669cbb4a3bd099b1b4d7f9
parent 971a51ce772f401beff8f4fabb224ef6a333f413
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 18 Dec 2017 14:49:19 +0000

[as-z80] Add Jump group

Diffstat:
Mas/target/gen.awk | 4++++
Mas/target/x80/ins.c | 14++++++++++++++
Mas/target/x80/proc.h | 10++++++++++
Mas/target/x80/x80.dat | 10++++++++++
4 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/as/target/gen.awk b/as/target/gen.awk @@ -81,6 +81,10 @@ function str2args(s, args, i, out, n) out = out "AINDEX_IY" } else if (match(a, /^\(IX\+n\)/)) { out = out "AINDEX_IX" + } else if (match(a, /^ss/)) { + out = out "AREG_SSCLASS" + } else if (match(a, /^cc/)) { + out = out "AREG_CCCLASS" } else if (match(a, /^dd/)) { out = out "AREG_DDCLASS" } else if (match(a, /^qq/)) { diff --git a/as/target/x80/ins.c b/as/target/x80/ins.c @@ -366,3 +366,17 @@ idx_bit(Op *op, Node **args) /* TODO */ abort(); } + +void +cc_imm16(Op *op, Node **args) +{ + /* TODO */ + abort(); +} + +void +jr(Op *op, Node **args) +{ + /* TODO */ + abort(); +} diff --git a/as/target/x80/proc.h b/as/target/x80/proc.h @@ -29,6 +29,14 @@ enum args { AREG_AF_, AREG_SP, + AREG_NZ, + AREG_Z, + AREG_NC, + AREG_PO, + AREG_PE, + AREG_P, + AREG_M, + AREG_RCLASS, /* register class for B, C, D, E, H, L and A */ AREG_PCLASS, /* register class for B, C, D, E, IXH, IXL and A */ AREG_QCLASS, /* register class for B, C, D, E, IYH, IYL and A */ @@ -36,6 +44,8 @@ enum args { AREG_QQCLASS, /* register class for BC, DE, HL and AF */ AREG_PPCLASS, /* register class for BC, DE, IX and SP */ AREG_RRCLASS, /* register class for BC, DE, IY and SP */ + AREG_SSCLASS, /* flag class for NZ, Z, NC, C, PO, PE, P, M */ + AREG_CCCLASS, /* flag class for C, NC, Z, NZ */ AINDEX_IX, /* (IX+d) */ AINDEX_IY, /* (IX+d) */ diff --git a/as/target/x80/x80.dat b/as/target/x80/x80.dat @@ -43,6 +43,8 @@ RET none 1 0xc9 noargs Z80,R800,GB80 # qq is any register from BC, DE, HL, AF # pp is any register from BC, DE, IX, SP # rr is any register from BC, DE, IY, SP +# cc is any flag from NZ, Z, NC, C, PO, PE, P, M +# ss is any flag from C, NC, Z, NZ # 8 bit load group LD r,imm8 2 0x06 r8_imm8 Z80,R800,GB80 @@ -329,3 +331,11 @@ OUTI none 2 0xed,0xa3 noargs Z80,R800 OTIR none 2 0xed,0xb3 noargs Z80,R800 OUTD none 2 0xed,0xab noargs Z80,R800 OTDR none 2 0xed,0xbb noargs Z80,R800 + +# Jump group +JP imm16 3 0xc3 imm16 Z80,R800,GB80 +JP cc,imm16 3 0xc2 cc_imm16 Z80,R800,GB80 +JR imm8 2 0x18 jr Z80,R800,GB80 +JR ss,imm8 2 0x00 jr Z80,R800,GB80 +JP IY 2 0xfd,0xe9 noargs Z80,R800 +DJNZ imm8 2 0x10 jr Z80,R800,GB80