summaryrefslogtreecommitdiff
path: root/opcodes/msp430-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-01-02 17:26:11 +0000
committerNick Clifton <nickc@redhat.com>2004-01-02 17:26:11 +0000
commit11370e079cd41ff857181ff966635dbef6c7cc39 (patch)
tree374dc3ee576cc4c1659ff7284f0f1862c6fc5a71 /opcodes/msp430-dis.c
parente808947a4b826aa90288e37be07c583a52ca0a90 (diff)
downloadbinutils-redhat-11370e079cd41ff857181ff966635dbef6c7cc39.tar.gz
Catch a bug in the msp430 disassembler where an add instruction was confused
with an rla instruction. Add a test for this to the testsuite.
Diffstat (limited to 'opcodes/msp430-dis.c')
-rw-r--r--opcodes/msp430-dis.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/opcodes/msp430-dis.c b/opcodes/msp430-dis.c
index 767ffa472c..1b5ffb1ec1 100644
--- a/opcodes/msp430-dis.c
+++ b/opcodes/msp430-dis.c
@@ -1,5 +1,5 @@
/* Disassemble MSP430 instructions.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
@@ -491,6 +491,10 @@ msp430_doubleoperand (info, opcode, addr, insn, op1, op2, comm1, comm2, cycles)
{
/* Absolute. */
dst = msp430dis_opcode (addr + 2, info);
+ /* If the 'src' field is not the same as the dst
+ then this is not an rla instruction. */
+ if (dst != msp430dis_opcode (addr + 4, info))
+ return 0;
cmd_len += 4;
*cycles = 6;
sprintf (op1, "&0x%04x", PS (dst));