* m68hc11-dis.c (print_insn): Treat bitmask and branch operands
at the end.
This commit is contained in:
parent
98db497e71
commit
ac8c616a59
2 changed files with 55 additions and 49 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-10-13 Stephane Carrez <stcarrez@nerim.fr>
|
||||||
|
|
||||||
|
* m68hc11-dis.c (print_insn): Treat bitmask and branch operands
|
||||||
|
at the end.
|
||||||
|
|
||||||
2002-09-30 Gavin Romig-Koch <gavin@redhat.com>
|
2002-09-30 Gavin Romig-Koch <gavin@redhat.com>
|
||||||
Ken Raeburn <raeburn@cygnus.com>
|
Ken Raeburn <raeburn@cygnus.com>
|
||||||
Aldy Hernandez <aldyh@redhat.com>
|
Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
|
@ -495,55 +495,6 @@ print_insn (memaddr, info, arch)
|
||||||
reg_dst_table[(buffer[0] & 7)]);
|
reg_dst_table[(buffer[0] & 7)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* M6811_OP_BITMASK and M6811_OP_JUMP_REL must be treated separately
|
|
||||||
and in that order. The brset/brclr insn have a bitmask and then
|
|
||||||
a relative branch offset. */
|
|
||||||
if (format & M6811_OP_BITMASK)
|
|
||||||
{
|
|
||||||
status = read_memory (memaddr + pos, &buffer[0], 1, info);
|
|
||||||
if (status != 0)
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
pos++;
|
|
||||||
(*info->fprintf_func) (info->stream, " #$%02x%s",
|
|
||||||
buffer[0] & 0x0FF,
|
|
||||||
(format & M6811_OP_JUMP_REL ? " " : ""));
|
|
||||||
format &= ~M6811_OP_BITMASK;
|
|
||||||
}
|
|
||||||
if (format & M6811_OP_JUMP_REL)
|
|
||||||
{
|
|
||||||
int val;
|
|
||||||
|
|
||||||
status = read_memory (memaddr + pos, &buffer[0], 1, info);
|
|
||||||
if (status != 0)
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
pos++;
|
|
||||||
val = (buffer[0] & 0x80) ? buffer[0] | 0xFFFFFF00 : buffer[0];
|
|
||||||
(*info->print_address_func) (memaddr + pos + val, info);
|
|
||||||
format &= ~M6811_OP_JUMP_REL;
|
|
||||||
}
|
|
||||||
else if (format & M6812_OP_JUMP_REL16)
|
|
||||||
{
|
|
||||||
int val;
|
|
||||||
|
|
||||||
status = read_memory (memaddr + pos, &buffer[0], 2, info);
|
|
||||||
if (status != 0)
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
pos += 2;
|
|
||||||
val = ((buffer[0] << 8) | (buffer[1] & 0x0FF));
|
|
||||||
if (val & 0x8000)
|
|
||||||
val |= 0xffff0000;
|
|
||||||
|
|
||||||
(*info->print_address_func) (memaddr + pos + val, info);
|
|
||||||
format &= ~M6812_OP_JUMP_REL16;
|
|
||||||
}
|
|
||||||
if (format & (M6811_OP_IMM16 | M6811_OP_IND16))
|
if (format & (M6811_OP_IMM16 | M6811_OP_IND16))
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
@ -641,6 +592,56 @@ print_insn (memaddr, info, arch)
|
||||||
(*info->print_address_func) (val, info);
|
(*info->print_address_func) (val, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* M6811_OP_BITMASK and M6811_OP_JUMP_REL must be treated separately
|
||||||
|
and in that order. The brset/brclr insn have a bitmask and then
|
||||||
|
a relative branch offset. */
|
||||||
|
if (format & M6811_OP_BITMASK)
|
||||||
|
{
|
||||||
|
status = read_memory (memaddr + pos, &buffer[0], 1, info);
|
||||||
|
if (status != 0)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
pos++;
|
||||||
|
(*info->fprintf_func) (info->stream, " #$%02x%s",
|
||||||
|
buffer[0] & 0x0FF,
|
||||||
|
(format & M6811_OP_JUMP_REL ? " " : ""));
|
||||||
|
format &= ~M6811_OP_BITMASK;
|
||||||
|
}
|
||||||
|
if (format & M6811_OP_JUMP_REL)
|
||||||
|
{
|
||||||
|
int val;
|
||||||
|
|
||||||
|
status = read_memory (memaddr + pos, &buffer[0], 1, info);
|
||||||
|
if (status != 0)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
pos++;
|
||||||
|
val = (buffer[0] & 0x80) ? buffer[0] | 0xFFFFFF00 : buffer[0];
|
||||||
|
(*info->print_address_func) (memaddr + pos + val, info);
|
||||||
|
format &= ~M6811_OP_JUMP_REL;
|
||||||
|
}
|
||||||
|
else if (format & M6812_OP_JUMP_REL16)
|
||||||
|
{
|
||||||
|
int val;
|
||||||
|
|
||||||
|
status = read_memory (memaddr + pos, &buffer[0], 2, info);
|
||||||
|
if (status != 0)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
pos += 2;
|
||||||
|
val = ((buffer[0] << 8) | (buffer[1] & 0x0FF));
|
||||||
|
if (val & 0x8000)
|
||||||
|
val |= 0xffff0000;
|
||||||
|
|
||||||
|
(*info->print_address_func) (memaddr + pos + val, info);
|
||||||
|
format &= ~M6812_OP_JUMP_REL16;
|
||||||
|
}
|
||||||
|
|
||||||
if (format & M6812_OP_PAGE)
|
if (format & M6812_OP_PAGE)
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
|
Loading…
Reference in a new issue