diff options
-rw-r--r-- | binutils/m68k-pinsn.c | 11 | ||||
-rw-r--r-- | binutils/sparc-pinsn.c | 17 |
2 files changed, 26 insertions, 2 deletions
diff --git a/binutils/m68k-pinsn.c b/binutils/m68k-pinsn.c index 5e796f5..4d491b4 100644 --- a/binutils/m68k-pinsn.c +++ b/binutils/m68k-pinsn.c @@ -24,6 +24,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdio.h> #include "opcode/m68k.h" +/* Sign-extend an (unsigned char). */ +#if __STDC__ == 1 +#define COERCE_SIGNED_CHAR(ch) ((signed char)(ch)) +#else +#define COERCE_SIGNED_CHAR(ch) ((int)(((ch) ^ 0x80) & 0xFF) - 128) +#endif + extern void print_address(); /* 68k instructions are never longer than this many bytes. */ @@ -42,7 +49,7 @@ static unsigned char *print_indexed (); static void print_base (); static int fetch_arg (); -#define NEXTBYTE(p) (p += 2, ((char *)p)[-1]) +#define NEXTBYTE(p) (p += 2, COERCE_SIGNED_CHAR(p[-1])) #define NEXTWORD(p) \ (p += 2, ((((char *)p)[-2]) << 8) + p[-1]) @@ -307,7 +314,7 @@ print_insn_arg (d, buffer, p, addr, stream) if (place == 'b') val = NEXTBYTE (p); else if (place == 'B') - val = buffer[1] > 127 ? buffer[1] - 256 : buffer[1]; + val = COERCE_SIGNED_CHAR(buffer[1]); else if (place == 'w' || place == 'W') val = NEXTWORD (p); else if (place == 'l' || place == 'L') diff --git a/binutils/sparc-pinsn.c b/binutils/sparc-pinsn.c index bef74f5..0cb9f64 100644 --- a/binutils/sparc-pinsn.c +++ b/binutils/sparc-pinsn.c @@ -242,14 +242,31 @@ memcpy(&insn,buffer, sizeof (insn)); #define freg(n) fprintf (stream, "%%%s", freg_names[n]) case 'e': + case 'v': /* double/even */ + case 'V': /* quad/multiple of 4 */ freg (insn.rs1); break; case 'f': + case 'B': /* double/even */ + case 'R': /* quad/multiple of 4 */ freg (insn.rs2); break; +#ifndef NO_V9 +#if 0 +/* Somebody who know needs to define rs3. */ + case 'j': + case 'u': /* double/even */ + case 'U': /* quad/multiple of 4 */ + freg (insn.rs3); + break; +#endif +#endif /* NO_V9 */ + case 'g': + case 'H': /* double/even */ + case 'J': /* quad/multiple of 4 */ freg (insn.rd); break; #undef freg |