aboutsummaryrefslogtreecommitdiff
path: root/opcodes/avr-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2019-10-09 13:48:06 +0100
committerNick Clifton <nickc@redhat.com>2019-10-09 13:48:06 +0100
commit1d3787499d6edd07b30f3fc7b26962a1c695b8a4 (patch)
tree1d09c665560e756e49860f513820650db3095226 /opcodes/avr-dis.c
parent8610e0fd93ea253f9beb9ebb6e50e8807ed83327 (diff)
downloadgdb-1d3787499d6edd07b30f3fc7b26962a1c695b8a4.zip
gdb-1d3787499d6edd07b30f3fc7b26962a1c695b8a4.tar.gz
gdb-1d3787499d6edd07b30f3fc7b26962a1c695b8a4.tar.bz2
Fix the disassembly of the LDS and STS instructions of the AVR architecture.
PR 25041 opcodes * avr-dis.c (avr_operand): Fix construction of address for lds/sts instructions. gas * testsuite/gas/avr/pr25041.s: New test. * testsuite/gas/avr/pr25041.d: New test driver.
Diffstat (limited to 'opcodes/avr-dis.c')
-rw-r--r--opcodes/avr-dis.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/opcodes/avr-dis.c b/opcodes/avr-dis.c
index b847ee9..ab38366 100644
--- a/opcodes/avr-dis.c
+++ b/opcodes/avr-dis.c
@@ -198,6 +198,8 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
{
unsigned int val = ((insn & 0xf) | ((insn & 0x600) >> 5)
| ((insn & 0x100) >> 2));
+ if ((insn & 0x100) == 0)
+ val |= 0x80;
*sym = 1;
*sym_addr = val | 0x800000;
sprintf (buf, "0x%02x", val);