diff options
Diffstat (limited to 'opcodes/z8kgen.c')
-rw-r--r-- | opcodes/z8kgen.c | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/opcodes/z8kgen.c b/opcodes/z8kgen.c index c8f3970..4029bf1c 100644 --- a/opcodes/z8kgen.c +++ b/opcodes/z8kgen.c @@ -52,9 +52,9 @@ struct op opt[] = "------", 10, 8, "1011 1001 imm8", "rsvdb9", 0, "------", 10, 8, "1011 1111 imm8", "rsvdbf", 0, - "---V--", 11, 16, "1011 1011 ssN0 1001 0000 rrrr ddN0 1000", "ldd @rs,@rd,rr", 0, - "---V--", 11, 16, "1011 1011 ssN0 1001 0000 rrrr ddN0 0000", "lddr @rs,@rd,rr", 0, - "---V--", 11, 8, "1011 1011 ssN0 1001 0000 rrrr ddN0 0000", "lddrb @rs,@rd,rr", 0, + "---V--", 11, 16, "1011 1011 ssN0 1001 0000 rrrr ddN0 1000", "ldd @rd,@rs,rr", 0, + "---V--", 11, 16, "1011 1011 ssN0 1001 0000 rrrr ddN0 0000", "lddr @rd,@rs,rr", 0, + "---V--", 11, 8, "1011 1010 ssN0 1001 0000 rrrr ddN0 0000", "lddrb @rd,@rs,rr", 0, "---V--", 11, 16, "1011 1011 ssN0 0001 0000 rrrr ddN0 0000", "ldir @rd,@rs,rr", 0, "CZSV--", 11, 16, "1011 1011 ssN0 0000 0000 rrrr dddd cccc", "cpi rd,@rs,rr,cc", 0, "CZSV--", 11, 16, "1011 1011 ssN0 0100 0000 rrrr dddd cccc", "cpir rd,@rs,rr,cc", 0, @@ -62,7 +62,7 @@ struct op opt[] = "---V--", 11, 16, "1011 1011 ssN0 0001 0000 rrrr ddN0 1000", "ldi @rd,@rs,rr", 0, "CZSV--", 11, 16, "1011 1011 ssN0 1000 0000 rrrr dddd cccc", "cpd rd,@rs,rr,cc", 0, "---V--", 11, 8, "1011 1010 ssN0 0001 0000 rrrr ddN0 0000", "ldirb @rd,@rs,rr", 0, - "---V--", 11, 8, "1011 1010 ssN0 1001 0000 rrrr ddN0 1000", "lddb @rs,@rd,rr", 0, + "---V--", 11, 8, "1011 1010 ssN0 1001 0000 rrrr ddN0 1000", "lddb @rd,@rs,rr", 0, "---V--", 11, 8, "1011 1010 ssN0 0001 0000 rrrr ddN0 1000", "ldib @rd,@rs,rr", 0, "CZSV--", 11, 8, "1011 1010 ssN0 1000 0000 rrrr dddd cccc", "cpdb rbd,@rs,rr,cc", 0, "CZSV--", 11, 8, "1011 1010 ssN0 1100 0000 rrrr dddd cccc", "cpdrb rbd,@rs,rr,cc", 0, @@ -140,7 +140,7 @@ struct op opt[] = "-ZSP--", 15, 8, "0100 1100 0000 0000 address_dst", "comb address_dst", 0, "-ZSP--", 16, 8, "0100 1100 ddN0 0000 address_dst", "comb address_dst(rd)", 0, "-ZSP--", 7, 8, "1000 1100 dddd 0000", "comb rbd", 0, - "CZSP--", 7, 16, "1000 1101 imm4 0101", "comflg flags", 0, + "CZSP--", 7, 16, "1000 1101 flags 0101", "comflg flags", 0, "CZSV--", 11, 16, "0000 1101 ddN0 0001 imm16", "cp @rd,imm16", 0, "CZSV--", 15, 16, "0100 1101 ddN0 0001 address_dst imm16", "cp address_dst(rd),imm16", 0, @@ -168,7 +168,7 @@ struct op opt[] = "CZSV--", 8, 32, "1001 0000 ssss dddd", "cpl rrd,rrs", 0, "CZS---", 5, 8, "1011 0000 dddd 0000", "dab rbd", 0, - "------", 11, 16, "1111 dddd 1disp7", "dbjnz rbd,disp7", 0, + "------", 11, 16, "1111 dddd 0disp7", "dbjnz rbd,disp7", 0, "-ZSV--", 11, 16, "0010 1011 ddN0 imm4m1", "dec @rd,imm4m1", 0, "-ZSV--", 14, 16, "0110 1011 ddN0 imm4m1 address_dst", "dec address_dst(rd),imm4m1", 0, "-ZSV--", 13, 16, "0110 1011 0000 imm4m1 address_dst", "dec address_dst,imm4m1", 0, @@ -190,7 +190,7 @@ struct op opt[] = "CZSV--", 744, 32, "0001 1010 0000 dddd imm32", "divl rqd,imm32", 0, "CZSV--", 744, 32, "1001 1010 ssss dddd", "divl rqd,rrs", 0, - "------", 11, 16, "1111 dddd 0disp7", "djnz rd,disp7", 0, + "------", 11, 16, "1111 dddd 1disp7", "djnz rd,disp7", 0, "------", 7, 16, "0111 1100 0000 01ii", "ei i2", 0, "------", 6, 16, "1010 1101 ssss dddd", "ex rd,rs", 0, "------", 12, 16, "0010 1101 ssN0 dddd", "ex rd,@rs", 0, @@ -210,7 +210,7 @@ struct op opt[] = "------", 10, 16, "0011 1101 ssN0 dddd", "in rd,@rs", 0, "------", 12, 16, "0011 1101 dddd 0100 imm16", "in rd,imm16", 0, "------", 12, 8, "0011 1100 ssN0 dddd", "inb rbd,@rs", 0, - "------", 10, 8, "0011 1100 dddd 0100 imm16", "inb rbd,imm16", 0, + "------", 10, 8, "0011 1010 dddd 0100 imm16", "inb rbd,imm16", 0, "-ZSV--", 11, 16, "0010 1001 ddN0 imm4m1", "inc @rd,imm4m1", 0, "-ZSV--", 14, 16, "0110 1001 ddN0 imm4m1 address_dst", "inc address_dst(rd),imm4m1", 0, "-ZSV--", 13, 16, "0110 1001 0000 imm4m1 address_dst", "inc address_dst,imm4m1", 0, @@ -221,8 +221,8 @@ struct op opt[] = "-ZSV--", 4, 8, "1010 1000 dddd imm4m1", "incb rbd,imm4m1", 0, "---V--", 21, 16, "0011 1011 ssN0 1000 0000 aaaa ddN0 1000", "ind @rd,@rs,ra", 0, "---V--", 21, 8, "0011 1010 ssN0 1000 0000 aaaa ddN0 1000", "indb @rd,@rs,rba", 0, - "---V--", 21, 8, "0011 1100 ssN0 0000 0000 aaaa ddN0 1000", "inib @rd,@rs,ra", 0, - "---V--", 21, 16, "0011 1100 ssN0 0000 0000 aaaa ddN0 0000", "inibr @rd,@rs,ra", 0, + "---V--", 21, 8, "0011 1010 ssN0 0000 0000 aaaa ddN0 1000", "inib @rd,@rs,ra", 0, + "---V--", 21, 16, "0011 1010 ssN0 0000 0000 aaaa ddN0 0000", "inibr @rd,@rs,ra", 0, "CZSVDH", 13, 16, "0111 1011 0000 0000", "iret", 0, "------", 10, 16, "0001 1110 ddN0 cccc", "jp cc,@rd", 0, "------", 7, 16, "0101 1110 0000 cccc address_dst", "jp cc,address_dst", 0, @@ -248,7 +248,7 @@ struct op opt[] = "------", 7, 8, "0000 1100 ddN0 0101 imm8 imm8", "ldb @rd,imm8", 0, "------", 8, 8, "0010 1110 ddN0 ssss", "ldb @rd,rbs", 0, "------", 15, 8, "0100 1100 ddN0 0101 address_dst imm8 imm8", "ldb address_dst(rd),imm8", 0, - "------", 12, 8, "0100 1110 ddN0 ssN0 address_dst", "ldb address_dst(rd),rbs", 0, + "------", 12, 8, "0110 1110 ddN0 ssss address_dst", "ldb address_dst(rd),rbs", 0, "------", 14, 8, "0100 1100 0000 0101 address_dst imm8 imm8", "ldb address_dst,imm8", 0, "------", 11, 8, "0110 1110 0000 ssss address_dst", "ldb address_dst,rbs", 0, "------", 14, 8, "0011 0010 ddN0 ssss imm16", "ldb rd(imm16),rbs", 0, @@ -285,7 +285,7 @@ struct op opt[] = "------", 5, 16, "1011 1101 dddd imm4", "ldk rd,imm4", 0, "------", 11, 16, "0001 1100 ddN0 1001 0000 ssss 0000 nminus1", "ldm @rd,rs,n", 0, - "------", 15, 16, "0101 1100 ddN0 1001 0000 ssN0 0000 nminus1 address_dst", "ldm address_dst(rd),rs,n", 0, + "------", 15, 16, "0101 1100 ddN0 1001 0000 ssss 0000 nminus1 address_dst", "ldm address_dst(rd),rs,n", 0, "------", 14, 16, "0101 1100 0000 1001 0000 ssss 0000 nminus1 address_dst", "ldm address_dst,rs,n", 0, "------", 11, 16, "0001 1100 ssN0 0001 0000 dddd 0000 nminus1", "ldm rd,@rs,n", 0, "------", 15, 16, "0101 1100 ssN0 0001 0000 dddd 0000 nminus1 address_src", "ldm rd,address_src(rs),n", 0, @@ -345,9 +345,10 @@ struct op opt[] = "---V--", 0, 8, "0011 1110 ddN0 ssss", "outb @rd,rbs", 0, "---V--", 0, 8, "0011 1010 ssss 0110 imm16", "outb imm16,rbs", 0, "---V--", 0, 16, "0011 1011 ssN0 1010 0000 aaaa ddN0 1000", "outd @rd,@rs,ra", 0, - "---V--", 0, 8, "0011 1010 ssN0 1010 0000 aaaa ddN0 1000", "outdb @rd,@rs,rba", 0, - "---V--", 0, 8, "0011 1100 ssN0 0010 0000 aaaa ddN0 1000", "outib @rd,@rs,ra", 0, - "---V--", 0, 16, "0011 1100 ssN0 0010 0000 aaaa ddN0 0000", "outibr @rd,@rs,ra", 0, + "---V--", 0, 16, "0011 1010 ssN0 1010 0000 aaaa ddN0 1000", "outdb @rd,@rs,rba", 0, + "---V--", 0, 16, "0011 1011 ssN0 0010 0000 aaaa ddN0 1000", "outi @rd,@rs,ra", 0, + "---V--", 0, 16, "0011 1010 ssN0 0010 0000 aaaa ddN0 1000", "outib @rd,@rs,ra", 0, + "---V--", 0, 16, "0011 1010 ssN0 0010 0000 aaaa ddN0 0000", "outibr @rd,@rs,ra", 0, "------", 12, 16, "0001 0111 ssN0 ddN0", "pop @rd,@rs", 0, "------", 16, 16, "0101 0111 ssN0 ddN0 address_dst", "pop address_dst(rd),@rs", 0, @@ -382,7 +383,7 @@ struct op opt[] = "------", 4, 8, "1010 0010 dddd imm4", "resb rbd,imm4", 0, "------", 10, 8, "0010 0010 0000 ssss 0000 dddd 0000 0000", "resb rbd,rs", 0, - "CZSV--", 7, 16, "1000 1101 imm4 0011", "resflg imm4", 0, + "CZSV--", 7, 16, "1000 1101 flags 0011", "resflg flags", 0, "------", 10, 16, "1001 1110 0000 cccc", "ret cc", 0, "CZSV--", 6, 16, "1011 0011 dddd 00I0", "rl rd,imm1or2", 0, @@ -422,14 +423,14 @@ struct op opt[] = "------", 4, 8, "1010 0100 dddd imm4", "setb rbd,imm4", 0, "------", 10, 8, "0010 0100 0000 ssss 0000 dddd 0000 0000", "setb rbd,rs", 0, - "CZSV--", 7, 16, "1000 1101 imm4 0001", "setflg imm4", 0, + "CZSV--", 7, 16, "1000 1101 flags 0001", "setflg flags", 0, - "------", 0, 8, "0011 1100 dddd 0101 imm16", "sinb rbd,imm16", 0, - "------", 0, 8, "0011 1101 dddd 0101 imm16", "sinb rd,imm16", 0, + "------", 0, 8, "0011 1010 dddd 0101 imm16", "sinb rbd,imm16", 0, + "------", 0, 8, "0011 1011 dddd 0101 imm16", "sin rd,imm16", 0, "------", 0, 16, "0011 1011 ssN0 1000 0001 aaaa ddN0 1000", "sind @rd,@rs,ra", 0, "------", 0, 8, "0011 1010 ssN0 1000 0001 aaaa ddN0 1000", "sindb @rd,@rs,rba", 0, - "------", 0, 8, "0011 1100 ssN0 0001 0000 aaaa ddN0 1000", "sinib @rd,@rs,ra", 0, - "------", 0, 16, "0011 1100 ssN0 0001 0000 aaaa ddN0 0000", "sinibr @rd,@rs,ra", 0, + "------", 0, 8, "0011 1010 ssN0 0001 0000 aaaa ddN0 1000", "sinib @rd,@rs,ra", 0, + "------", 0, 16, "0011 1010 ssN0 0001 0000 aaaa ddN0 0000", "sinibr @rd,@rs,ra", 0, "CZSV--", 13, 16, "1011 0011 dddd 1001 0000 0000 imm8", "sla rd,imm8", 0, "CZSV--", 13, 8, "1011 0010 dddd 1001 0000 0000 imm8", "slab rbd,imm8", 0, @@ -443,21 +444,21 @@ struct op opt[] = "------", 0, 8, "0011 1010 ssss 0111 imm16", "soutb imm16,rbs", 0, "------", 0, 16, "0011 1011 ssN0 1011 0000 aaaa ddN0 1000", "soutd @rd,@rs,ra", 0, "------", 0, 8, "0011 1010 ssN0 1011 0000 aaaa ddN0 1000", "soutdb @rd,@rs,rba", 0, - "------", 0, 8, "0011 1100 ssN0 0011 0000 aaaa ddN0 1000", "soutib @rd,@rs,ra", 0, - "------", 0, 16, "0011 1100 ssN0 0011 0000 aaaa ddN0 0000", "soutibr @rd,@rs,ra", 0, + "------", 0, 8, "0011 1010 ssN0 0011 0000 aaaa ddN0 1000", "soutib @rd,@rs,ra", 0, + "------", 0, 16, "0011 1010 ssN0 0011 0000 aaaa ddN0 0000", "soutibr @rd,@rs,ra", 0, "CZSV--", 13, 16, "1011 0011 dddd 1001 1111 1111 nim8", "sra rd,imm8", 0, - "CZSV--", 13, 8, "1011 0010 dddd 1001 1111 1111 nim8", "srab rbd,imm8", 0, + "CZSV--", 13, 8, "1011 0010 dddd 1001 0000 0000 nim8", "srab rbd,imm8", 0, "CZSV--", 13, 32, "1011 0011 dddd 1101 1111 1111 nim8", "sral rrd,imm8", 0, "CZSV--", 13, 16, "1011 0011 dddd 0001 1111 1111 nim8", "srl rd,imm8", 0, - "CZSV--", 13, 8, "1011 0010 dddd 0001 1111 1111 nim8", "srlb rbd,imm8", 0, + "CZSV--", 13, 8, "1011 0010 dddd 0001 0000 0000 nim8", "srlb rbd,imm8", 0, "CZSV--", 13, 32, "1011 0011 dddd 0101 1111 1111 nim8", "srll rrd,imm8", 0, "CZSV--", 7, 16, "0000 0011 ssN0 dddd", "sub rd,@rs", 0, "CZSV--", 9, 16, "0100 0011 0000 dddd address_src", "sub rd,address_src", 0, "CZSV--", 10, 16, "0100 0011 ssN0 dddd address_src", "sub rd,address_src(rs)", 0, - "CZSV--", 7, 16, "0000 0010 0000 dddd imm16", "sub rd,imm16", 0, + "CZSV--", 7, 16, "0000 0011 0000 dddd imm16", "sub rd,imm16", 0, "CZSV--", 4, 16, "1000 0011 ssss dddd", "sub rd,rs", 0, "CZSVDH", 7, 8, "0000 0010 ssN0 dddd", "subb rbd,@rs", 0, @@ -494,8 +495,9 @@ struct op opt[] = "-ZSV--", 25, 8, "1011 1000 ddN0 1100 0000 aaaa ssN0 0000", "trdrb @rd,@rs,rba", 0, "-ZSV--", 25, 8, "1011 1000 ddN0 0000 0000 rrrr ssN0 0000", "trib @rd,@rs,rbr", 0, "-ZSV--", 25, 8, "1011 1000 ddN0 0100 0000 rrrr ssN0 0000", "trirb @rd,@rs,rbr", 0, + "-ZSV--", 25, 8, "1011 1000 aaN0 1010 0000 rrrr bbN0 0000", "trtdb @ra,@rb,rbr", 0, "-ZSV--", 25, 8, "1011 1000 aaN0 1110 0000 rrrr bbN0 1110", "trtdrb @ra,@rb,rbr", 0, - "-ZSV--", 25, 8, "1011 1000 aaN0 0010 0000 rrrr bbN0 0000", "trtib @ra,@rb,rr", 0, + "-ZSV--", 25, 8, "1011 1000 aaN0 0010 0000 rrrr bbN0 0000", "trtib @ra,@rb,rbr", 0, "-ZSV--", 25, 8, "1011 1000 aaN0 0110 0000 rrrr bbN0 1110", "trtirb @ra,@rb,rbr", 0, "-ZSV--", 25, 8, "1011 1000 aaN0 1010 0000 rrrr bbN0 0000", "trtrb @ra,@rb,rbr", 0, @@ -520,6 +522,10 @@ struct op opt[] = "-ZSP--", 10, 8, "0100 1000 ssN0 dddd address_src", "xorb rbd,address_src(rs)", 0, "-ZSP--", 7, 8, "0000 1000 0000 dddd imm8 imm8", "xorb rbd,imm8", 0, "-ZSP--", 4, 8, "1000 1000 ssss dddd", "xorb rbd,rbs", 0, + + "------", 7, 32, "1000 1100 dddd 0001", "ldctlb rbd,ctrl", 0, + "CZSVDH", 7, 32, "1000 1100 ssss 1001", "ldctlb ctrl,rbs", 0, + "*", 4, 8, "1000 1000 ssss dddd", "xorb rbd,rbs", 0, "*", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -1203,6 +1209,10 @@ gas () printf ("#define OPC_rsvd9f 172\n"); printf ("#define OPC_rsvdb9 172\n"); printf ("#define OPC_rsvdbf 172\n"); + printf ("#define OPC_outi 173\n"); + printf ("#define OPC_ldctlb 174\n"); + printf ("#define OPC_sin 175\n"); + printf ("#define OPC_trtdb 176\n"); #if 0 for (i = 0; toks[i].token; i++) printf ("#define %s\t0x%x\n", toks[i].token, i * 16); |