diff options
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 12 | ||||
-rw-r--r-- | opcodes/m68hc11-dis.c | 99 | ||||
-rw-r--r-- | opcodes/sparc-opc.c | 38 |
3 files changed, 81 insertions, 68 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 6128a7d1cfa..558b900aa70 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,15 @@ +2002-10-07 Nathan Tallent <eraxxon@alumni.rice.edu> + + * sparc-opc.c (sparc_opcodes) <fb, fba, fbe, fbz, fbg, fbge, + fbl, fble, fblg, fbn, fbne, fbnz, fbo, fbu, fbue, fbug, fbuge, + fbul, fbule>: Add conditional/unconditional branch + classification. + +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> Ken Raeburn <raeburn@cygnus.com> Aldy Hernandez <aldyh@redhat.com> diff --git a/opcodes/m68hc11-dis.c b/opcodes/m68hc11-dis.c index c721d16e0c4..bcd3ee5103f 100644 --- a/opcodes/m68hc11-dis.c +++ b/opcodes/m68hc11-dis.c @@ -495,55 +495,6 @@ print_insn (memaddr, info, arch) 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)) { int val; @@ -641,6 +592,56 @@ print_insn (memaddr, info, arch) (*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) { int val; diff --git a/opcodes/sparc-opc.c b/opcodes/sparc-opc.c index 5c06d01df14..00102323f2b 100644 --- a/opcodes/sparc-opc.c +++ b/opcodes/sparc-opc.c @@ -1440,25 +1440,25 @@ cond ("bz", "tz", CONDZ, F_CONDBR|F_ALIAS), /* for e */ FBRX(fop, F2(0, 5)|COND(mask), F2(~0, ~5)|COND(~(mask)), flags), /* v9 */ \ FBR(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags) -CONDFC ("fb", "cb", 0x8, 0), -CONDFCL ("fba", "cba", 0x8, F_ALIAS), -CONDFC ("fbe", "cb0", 0x9, 0), -CONDF ("fbz", 0x9, F_ALIAS), -CONDFC ("fbg", "cb2", 0x6, 0), -CONDFC ("fbge", "cb02", 0xb, 0), -CONDFC ("fbl", "cb1", 0x4, 0), -CONDFC ("fble", "cb01", 0xd, 0), -CONDFC ("fblg", "cb12", 0x2, 0), -CONDFCL ("fbn", "cbn", 0x0, 0), -CONDFC ("fbne", "cb123", 0x1, 0), -CONDF ("fbnz", 0x1, F_ALIAS), -CONDFC ("fbo", "cb012", 0xf, 0), -CONDFC ("fbu", "cb3", 0x7, 0), -CONDFC ("fbue", "cb03", 0xa, 0), -CONDFC ("fbug", "cb23", 0x5, 0), -CONDFC ("fbuge", "cb023", 0xc, 0), -CONDFC ("fbul", "cb13", 0x3, 0), -CONDFC ("fbule", "cb013", 0xe, 0), +CONDFC ("fb", "cb", 0x8, F_UNBR), +CONDFCL ("fba", "cba", 0x8, F_UNBR|F_ALIAS), +CONDFC ("fbe", "cb0", 0x9, F_CONDBR), +CONDF ("fbz", 0x9, F_CONDBR|F_ALIAS), +CONDFC ("fbg", "cb2", 0x6, F_CONDBR), +CONDFC ("fbge", "cb02", 0xb, F_CONDBR), +CONDFC ("fbl", "cb1", 0x4, F_CONDBR), +CONDFC ("fble", "cb01", 0xd, F_CONDBR), +CONDFC ("fblg", "cb12", 0x2, F_CONDBR), +CONDFCL ("fbn", "cbn", 0x0, F_UNBR), +CONDFC ("fbne", "cb123", 0x1, F_CONDBR), +CONDF ("fbnz", 0x1, F_CONDBR|F_ALIAS), +CONDFC ("fbo", "cb012", 0xf, F_CONDBR), +CONDFC ("fbu", "cb3", 0x7, F_CONDBR), +CONDFC ("fbue", "cb03", 0xa, F_CONDBR), +CONDFC ("fbug", "cb23", 0x5, F_CONDBR), +CONDFC ("fbuge", "cb023", 0xc, F_CONDBR), +CONDFC ("fbul", "cb13", 0x3, F_CONDBR), +CONDFC ("fbule", "cb013", 0xe, F_CONDBR), #undef CONDFC #undef CONDFCL |