* pdp11-dis.c (print_insn_pdp11): Handle illegal instructions.

Also, break out of the loop as soon as an instruction has been
	printed.
This commit is contained in:
Alan Modra 2001-11-23 07:09:48 +00:00
parent 82e831844a
commit c6843df52b
2 changed files with 26 additions and 12 deletions

View file

@ -1,3 +1,9 @@
2001-11-23 Lars Brinkhoff <lars@nocrew.org>
* pdp11-dis.c (print_insn_pdp11): Handle illegal instructions.
Also, break out of the loop as soon as an instruction has been
printed.
2001-11-17 matthew green <mrg@redhat.com> 2001-11-17 matthew green <mrg@redhat.com>
* ppc-opc.c (mfvrsave, mtvrsave): New instructions. * ppc-opc.c (mfvrsave, mtvrsave): New instructions.

View file

@ -216,12 +216,12 @@ print_insn_pdp11 (memaddr, info)
{ {
case PDP11_OPCODE_NO_OPS: case PDP11_OPCODE_NO_OPS:
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
break; goto done;
case PDP11_OPCODE_REG: case PDP11_OPCODE_REG:
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
print_reg (dst, info); print_reg (dst, info);
break; goto done;
case PDP11_OPCODE_OP: case PDP11_OPCODE_OP:
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
@ -229,7 +229,7 @@ print_insn_pdp11 (memaddr, info)
dst |= JUMP; dst |= JUMP;
if (print_operand (&memaddr, dst, info) < 0) if (print_operand (&memaddr, dst, info) < 0)
return -1; return -1;
break; goto done;
case PDP11_OPCODE_REG_OP: case PDP11_OPCODE_REG_OP:
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
@ -239,7 +239,7 @@ print_insn_pdp11 (memaddr, info)
dst |= JUMP; dst |= JUMP;
if (print_operand (&memaddr, dst, info) < 0) if (print_operand (&memaddr, dst, info) < 0)
return -1; return -1;
break; goto done;
case PDP11_OPCODE_REG_OP_REV: case PDP11_OPCODE_REG_OP_REV:
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
@ -247,7 +247,7 @@ print_insn_pdp11 (memaddr, info)
return -1; return -1;
FPRINTF (F, OPERAND_SEPARATOR); FPRINTF (F, OPERAND_SEPARATOR);
print_reg (src, info); print_reg (src, info);
break; goto done;
case PDP11_OPCODE_AC_OP: case PDP11_OPCODE_AC_OP:
{ {
int ac = (opcode & 0xe0) >> 6; int ac = (opcode & 0xe0) >> 6;
@ -257,7 +257,7 @@ print_insn_pdp11 (memaddr, info)
FPRINTF (F, OPERAND_SEPARATOR); FPRINTF (F, OPERAND_SEPARATOR);
if (print_operand (&memaddr, dst, info) < 0) if (print_operand (&memaddr, dst, info) < 0)
return -1; return -1;
break; goto done;
} }
case PDP11_OPCODE_OP_OP: case PDP11_OPCODE_OP_OP:
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
@ -267,7 +267,7 @@ print_insn_pdp11 (memaddr, info)
FPRINTF (F, OPERAND_SEPARATOR); FPRINTF (F, OPERAND_SEPARATOR);
if (print_operand (&memaddr, dst, info) < 0) if (print_operand (&memaddr, dst, info) < 0)
return -1; return -1;
break; goto done;
case PDP11_OPCODE_DISPL: case PDP11_OPCODE_DISPL:
{ {
int displ = (opcode & 0xff) << 8; int displ = (opcode & 0xff) << 8;
@ -275,7 +275,7 @@ print_insn_pdp11 (memaddr, info)
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
(*info->print_address_func) (address, info); (*info->print_address_func) (address, info);
break; goto done;
} }
case PDP11_OPCODE_REG_DISPL: case PDP11_OPCODE_REG_DISPL:
{ {
@ -286,7 +286,7 @@ print_insn_pdp11 (memaddr, info)
print_reg (src, info); print_reg (src, info);
FPRINTF (F, OPERAND_SEPARATOR); FPRINTF (F, OPERAND_SEPARATOR);
(*info->print_address_func) (address, info); (*info->print_address_func) (address, info);
break; goto done;
} }
case PDP11_OPCODE_IMM8: case PDP11_OPCODE_IMM8:
{ {
@ -294,7 +294,7 @@ print_insn_pdp11 (memaddr, info)
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
FPRINTF (F, "%o", code); FPRINTF (F, "%o", code);
break; goto done;
} }
case PDP11_OPCODE_IMM6: case PDP11_OPCODE_IMM6:
{ {
@ -302,7 +302,7 @@ print_insn_pdp11 (memaddr, info)
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
FPRINTF (F, "%o", code); FPRINTF (F, "%o", code);
break; goto done;
} }
case PDP11_OPCODE_IMM3: case PDP11_OPCODE_IMM3:
{ {
@ -310,7 +310,14 @@ print_insn_pdp11 (memaddr, info)
FPRINTF (F, OP.name); FPRINTF (F, OP.name);
FPRINTF (F, AFTER_INSTRUCTION); FPRINTF (F, AFTER_INSTRUCTION);
FPRINTF (F, "%o", code); FPRINTF (F, "%o", code);
break; goto done;
}
case PDP11_OPCODE_ILLEGAL:
{
FPRINTF (F, ".word");
FPRINTF (F, AFTER_INSTRUCTION);
FPRINTF (F, "%o", opcode);
goto done;
} }
default: default:
/* TODO: is this a proper way of signalling an error? */ /* TODO: is this a proper way of signalling an error? */
@ -319,6 +326,7 @@ print_insn_pdp11 (memaddr, info)
} }
#undef OP #undef OP
} }
done:
return memaddr - start_memaddr; return memaddr - start_memaddr;
} }