aboutsummaryrefslogtreecommitdiff
path: root/opcodes/z80-dis.c
diff options
context:
space:
mode:
authorSergey Belyashov <sergey.belyashov@gmail.com>2020-03-17 16:55:32 +0000
committerNick Clifton <nickc@redhat.com>2020-03-17 16:55:32 +0000
commit68e52bc7ecfbfdc8d5f85716a8ac7668e211f360 (patch)
treeb6fad703f9e73ec0191841e9dcc13d15dae614ce /opcodes/z80-dis.c
parentecbbbdba7182865e522e0893915e9be487fe14b0 (diff)
downloadgdb-68e52bc7ecfbfdc8d5f85716a8ac7668e211f360.zip
gdb-68e52bc7ecfbfdc8d5f85716a8ac7668e211f360.tar.gz
gdb-68e52bc7ecfbfdc8d5f85716a8ac7668e211f360.tar.bz2
Fix a small set of Z80 problems.
PR 25641 PR 25668 PR 25633 gas Fix disassembling ED+A4/AC/B4/BC opcodes. Fix assembling lines containing colonless label and instruction with first operand inside parentheses. Fix registration of unsupported by target CPU registers. * config/tc-z80.c: See above. * config/tc-z80.h: See above. * testsuite/gas/z80/colonless.d: Update test. * testsuite/gas/z80/colonless.s: Likewise. * testsuite/gas/z80/ez80_adl_all.d: Likewise. * testsuite/gas/z80/ez80_unsup_regs.d: Likewise. * testsuite/gas/z80/ez80_z80_all.d: Likewise. * testsuite/gas/z80/gbz80_unsup_regs.d: Likewise. * testsuite/gas/z80/r800_unsup_regs.d: Likewise. * testsuite/gas/z80/unsup_regs.s: Likewise. * testsuite/gas/z80/z180_unsup_regs.d: Likewise. * testsuite/gas/z80/z80.exp: Likewise. * testsuite/gas/z80/z80_strict_unsup_regs.d: Likewise. * testsuite/gas/z80/z80_unsup_regs.d: Likewise. * testsuite/gas/z80/z80n_unsup_regs.d: Likewise. opcodes * z80-dis.c: Fix disassembling ED+A4/AC/B4/BC opcodes.
Diffstat (limited to 'opcodes/z80-dis.c')
-rw-r--r--opcodes/z80-dis.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/opcodes/z80-dis.c b/opcodes/z80-dis.c
index d66bd75..b23e8e9 100644
--- a/opcodes/z80-dis.c
+++ b/opcodes/z80-dis.c
@@ -401,24 +401,6 @@ cism (struct buffer *buf, disassemble_info * info, const char *txt ATTRIBUTE_UNU
}
static int
-cis2 (struct buffer *buf, disassemble_info * info, const char *txt ATTRIBUTE_UNUSED)
-{
- static char * opar[] = { "in", "out" };
- char * op;
- char c;
-
- c = buf->data[1];
- op = ((0x14 & c) == 0x14) ? "ot" : (opar[c & 1]);
- info->fprintf_func (info->stream,
- "%s%c2%s",
- op,
- (c & 0x08) ? 'd' : 'i',
- (c & 0x10) ? "r" : "");
- buf->n_used = 2;
- return buf->n_used;
-}
-
-static int
dump (struct buffer *buf, disassemble_info * info, const char *txt)
{
int i;
@@ -504,21 +486,28 @@ struct tab_elt opc_ed[] =
{ 0x7D, 0xFF, prt, "stmix", INSS_EZ80 },
{ 0x7E, 0xFF, prt, "rsmix", INSS_EZ80 },
{ 0x82, 0xE6, cism, "", INSS_Z180|INSS_EZ80 },
- { 0x84, 0xC7, cis2, "", INSS_EZ80 },
+ { 0x84, 0xFF, prt, "ini2", INSS_EZ80 },
{ 0x8A, 0xFF, prt_n_n, "push 0x%02x%%02x", INSS_Z80N },
+ { 0x8C, 0xFF, prt, "ind2", INSS_EZ80 },
{ 0x90, 0xFF, prt, "outinb", INSS_Z80N },
{ 0x91, 0xFF, prt_n_n, "nextreg 0x%02x,0x%%02x", INSS_Z80N },
{ 0x92, 0xFF, prt_n, "nextreg 0x%02x,a", INSS_Z80N },
{ 0x93, 0xFF, prt, "pixeldn", INSS_Z80N },
+ { 0x94, 0xFF, prt, "ini2r", INSS_EZ80 },
{ 0x94, 0xFF, prt, "pixelad", INSS_Z80N },
{ 0x95, 0xFF, prt, "setae", INSS_Z80N },
{ 0x98, 0xFF, prt, "jp (c)", INSS_Z80N },
+ { 0x9c, 0xFF, prt, "ind2r", INSS_EZ80 },
{ 0xA0, 0xE4, cis, "", INSS_ALL },
+ { 0xA4, 0xFF, prt, "outi2", INSS_EZ80 },
{ 0xA4, 0xFF, prt, "ldix", INSS_Z80N },
+ { 0xAC, 0xFF, prt, "outd2", INSS_EZ80 },
{ 0xAC, 0xFF, prt, "lddx", INSS_Z80N },
{ 0xA5, 0xFF, prt, "ldws", INSS_Z80N },
+ { 0xB4, 0xFF, prt, "oti2r", INSS_EZ80 },
{ 0xB4, 0xFF, prt, "ldirx", INSS_Z80N },
{ 0xB7, 0xFF, prt, "ldpirx", INSS_Z80N },
+ { 0xBC, 0xFF, prt, "otd2r", INSS_EZ80 },
{ 0xBC, 0xFF, prt, "lddrx", INSS_Z80N },
{ 0xC2, 0xFF, prt, "inirx", INSS_EZ80 },
{ 0xC3, 0xFF, prt, "otirx", INSS_EZ80 },