/* Print DEC PDP-11 instructions.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void print_freg PARAMS ((int freg, disassemble_info *info));
static int print_operand PARAMS ((bfd_vma *memaddr, int code,
disassemble_info *info));
+static int print_foperand PARAMS ((bfd_vma *memaddr, int code,
+ disassemble_info *info));
int print_insn_pdp11 PARAMS ((bfd_vma memaddr, disassemble_info *info));
static int
FPRINTF (F, "r%d", reg); break;
case 6: FPRINTF (F, "sp"); break;
case 7: FPRINTF (F, "pc"); break;
- default: /* error */
+ default: ; /* error */
}
}
if (reg == 7)
{
bfd_vma address = *memaddr + sign_extend (disp);
+ if (mode == 7)
+ FPRINTF (F, "*");
if (!(code & JUMP))
- FPRINTF (F, "*$");
+ FPRINTF (F, "$");
(*info->print_address_func) (address, info);
}
else
return 0;
}
+static int
+print_foperand (memaddr, code, info)
+ bfd_vma *memaddr;
+ int code;
+ disassemble_info *info;
+{
+ int mode = (code >> 3) & 7;
+ int reg = code & 7;
+
+ if (mode == 0)
+ print_freg (reg, info);
+ else
+ return print_operand (memaddr, code, info);
+
+ return 0;
+}
+
/* Print the PDP-11 instruction at address MEMADDR in debugged memory,
on INFO->STREAM. Returns length of the instruction, in bytes. */
if (print_operand (&memaddr, dst, info) < 0)
return -1;
goto done;
+ case PDP11_OPCODE_FOP:
+ FPRINTF (F, OP.name);
+ FPRINTF (F, AFTER_INSTRUCTION);
+ if (strcmp (OP.name, "jmp") == 0)
+ dst |= JUMP;
+ if (print_foperand (&memaddr, dst, info) < 0)
+ return -1;
+ goto done;
case PDP11_OPCODE_REG_OP:
FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION);
FPRINTF (F, OPERAND_SEPARATOR);
print_reg (src, info);
goto done;
+ case PDP11_OPCODE_AC_FOP:
+ {
+ int ac = (opcode & 0xe0) >> 6;
+ FPRINTF (F, OP.name);
+ FPRINTF (F, AFTER_INSTRUCTION);
+ print_freg (ac, info);
+ FPRINTF (F, OPERAND_SEPARATOR);
+ if (print_foperand (&memaddr, dst, info) < 0)
+ return -1;
+ goto done;
+ }
+ case PDP11_OPCODE_FOP_AC:
+ {
+ int ac = (opcode & 0xe0) >> 6;
+ FPRINTF (F, OP.name);
+ FPRINTF (F, AFTER_INSTRUCTION);
+ if (print_foperand (&memaddr, dst, info) < 0)
+ return -1;
+ FPRINTF (F, OPERAND_SEPARATOR);
+ print_freg (ac, info);
+ goto done;
+ }
case PDP11_OPCODE_AC_OP:
{
int ac = (opcode & 0xe0) >> 6;
return -1;
goto done;
}
+ case PDP11_OPCODE_OP_AC:
+ {
+ int ac = (opcode & 0xe0) >> 6;
+ FPRINTF (F, OP.name);
+ FPRINTF (F, AFTER_INSTRUCTION);
+ if (print_operand (&memaddr, dst, info) < 0)
+ return -1;
+ FPRINTF (F, OPERAND_SEPARATOR);
+ print_freg (ac, info);
+ goto done;
+ }
case PDP11_OPCODE_OP_OP:
FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION);
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);