summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorArnold Metselaar <arnold.metselaar@planet.nl>2008-09-14 08:38:02 +0000
committerArnold Metselaar <arnold.metselaar@planet.nl>2008-09-14 08:38:02 +0000
commitd04117369bdf589dd7ad899960b89a77fe0597ae (patch)
treec87ce8c4b9ae816166c77deb10997c0430ff8ac3 /opcodes
parent06e476f547819d9384168d8e768724ad222be54d (diff)
downloadbinutils-gdb-d04117369bdf589dd7ad899960b89a77fe0597ae.tar.gz
Fix bugs in the disassembly of some ld-instructions
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/z80-dis.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 6662ef40442..ab3b5c7bd0b 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-14 Arnold Metselaar <arnold.metselaar@planet.nl>
+
+ * z80-dis.c (prt_rr_nn): Fix register pair for two byte opcodes.
+ (tab_elt opc_ed): Add "ld r,a" and "ld r,a" instructions.
+
2008-09-11 H.J. Lu <hongjiu.lu@intel.com>
* i386-opc.tbl: Fix memory operand size for cmpXXXs[sd].
diff --git a/opcodes/z80-dis.c b/opcodes/z80-dis.c
index 98161d9e884..c9ee19e6dd2 100644
--- a/opcodes/z80-dis.c
+++ b/opcodes/z80-dis.c
@@ -128,8 +128,10 @@ static int
prt_rr_nn (struct buffer *buf, disassemble_info * info, char *txt)
{
char mytxt[TXTSIZ];
+ int rr;
- snprintf (mytxt, TXTSIZ, txt, rr_str[(buf->data[0] >> 4) & 3]);
+ rr = (buf->data[buf->n_fetch - 1] >> 4) & 3;
+ snprintf (mytxt, TXTSIZ, txt, rr_str[rr]);
return prt_nn (buf, info, mytxt);
}
@@ -297,9 +299,11 @@ struct tab_elt opc_ed[] =
{ 0x4A, 0xCF, prt_rr, "adc hl," },
{ 0x4B, 0xCF, prt_rr_nn, "ld %s,(0x%%04x)" },
{ 0x4D, 0xFF, prt, "reti" },
+ { 0x4F, 0xFF, prt, "ld r,a" },
{ 0x56, 0xFF, prt, "im 1" },
{ 0x57, 0xFF, prt, "ld a,i" },
{ 0x5E, 0xFF, prt, "im 2" },
+ { 0x5F, 0xFF, prt, "ld a,r" },
{ 0x67, 0xFF, prt, "rrd" },
{ 0x6F, 0xFF, prt, "rld" },
{ 0xA0, 0xE4, cis, "" },