Fixes for the encoding and decoding of the PDP11's SOB instruction
authorNick Clifton <nickc@redhat.com>
Fri, 1 Oct 2004 11:19:38 +0000 (11:19 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 1 Oct 2004 11:19:38 +0000 (11:19 +0000)
gas/ChangeLog
gas/config/tc-pdp11.c
gas/testsuite/ChangeLog
gas/testsuite/gas/pdp11/opcode.d
opcodes/ChangeLog
opcodes/pdp11-dis.c

index 3efc2909ef0ffbcfa5068ddb8ecde10649d1ca1a..c328820bdc4fa3f3dc3bc366b477fa603db05b06 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-01  Bill Farmer  <Bill@the-farmers.freeserve.co.uk>
+
+       * config/tc-pdp11.c (md_apply_fix3): Change to sign of the SOB
+       instruction's offset.
+
 2004-10-01  Adam Nemet  <anemet@lnxw.com>
 
        * (TARGET_FORMAT): Remove LynxOS COFF definition.
index f34adf69d670f18438b974b55edbafcfc592f6c6..4993fdd124ad2a61464a5f1793a877f302a085d0 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-pdp11.c - pdp11-specific -
-   Copyright 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -199,6 +199,7 @@ md_apply_fix3 (fixP, valP, seg)
     case BFD_RELOC_PDP11_DISP_6_PCREL:
       mask = 0x003f;
       shift = 1;
+      val = -val;
       break;
     default:
       BAD_CASE (fixP->fx_r_type);
index e7cd66c2c5f1815fbe99f5b4563e89200e0038de..623e629f82b347137e27e3807b74fe706811f13b 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-01  Bill Farmer  <Bill@the-farmers.freeserve.co.uk>
+
+       * gas/pdp11/opcode.d: Fix sob opcode value.
+
 2004-09-30  Paul Brook  <paul@codesourcery.com>
 
        * gas/arm/arch6zk.d: New file.
index 2e6a981fc74b5b186372e6a65b0a285cca185b06..4b81857dc2e68397655e7a00d6c73bbd6928342e 100644 (file)
@@ -134,7 +134,7 @@ Disassembly of section .text:
  108:  7c7f [   ]*cvtlpi
  10a:  7d80 [   ]*med
  10c:  7dea [   ]*xfc  52
- 10e:  7e3e [   ]*sob  r0, 10c <start2\+0x106>
+ 10e:  7e02 [   ]*sob  r0, 10c <start2\+0x106>
  110:  80fd [   ]*bpl  10c <start2\+0x106>
  112:  81fc [   ]*bmi  10c <start2\+0x106>
  114:  82fb [   ]*bhi  10c <start2\+0x106>
index cf49121abecedf3fc4963b3e8554d7dce28bf5b8..2dde35383cd93f38d6945b4a8e8b4209879c0a89 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-01  Bill Farmer  <Bill@the-farmers.freeserve.co.uk>
+
+       * pdp11-dis.c (print_insn_pdp11): Subtract the SOB's displacement
+       rather than add it.
+
 2004-09-30  Paul Brook  <paul@codesourcery.com>
 
        * arm-dis.c (print_insn_arm): Handle 'e' for SMI instruction.
index 4f5bf84aead8ad8af5451ed78bd20dc9ac73d87d..1756e53b7d93538fd0d02ef7bbe8365086a6bfb6 100644 (file)
@@ -342,7 +342,8 @@ print_insn_pdp11 (memaddr, info)
          case PDP11_OPCODE_REG_DISPL:
            {
              int displ = (opcode & 0x3f) << 10;
-             bfd_vma address = memaddr + (sign_extend (displ) >> 9);
+             bfd_vma address = memaddr - (displ >> 9);
+
              FPRINTF (F, OP.name);
              FPRINTF (F, AFTER_INSTRUCTION);
              print_reg (src, info);
This page took 0.06349 seconds and 4 git commands to generate.