diff options
author | Chris Demetriou <cgd@google.com> | 2003-01-02 22:04:55 +0000 |
---|---|---|
committer | Chris Demetriou <cgd@google.com> | 2003-01-02 22:04:55 +0000 |
commit | 440cc0bc1a3338bfbd5e098cb65483bc50c0bd57 (patch) | |
tree | 036fbd322e7fbff42fcd7aaab95f675e73186f42 /opcodes | |
parent | 64543e1acf3388a4318688720d3e242e93fcb00b (diff) | |
download | gdb-440cc0bc1a3338bfbd5e098cb65483bc50c0bd57.zip gdb-440cc0bc1a3338bfbd5e098cb65483bc50c0bd57.tar.gz gdb-440cc0bc1a3338bfbd5e098cb65483bc50c0bd57.tar.bz2 |
2003-01-02 Chris Demetriou <cgd@broadcom.com>
* mips-dis.c (print_insn_args): Use position extracted by "+A"
to calculate size for "+B". Redo code for "+C" so it shares
the same style as "+A" and "+B" now do.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 6 | ||||
-rw-r--r-- | opcodes/mips-dis.c | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 342eb91..18a16d3 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,11 @@ 2003-01-02 Chris Demetriou <cgd@broadcom.com> + * mips-dis.c (print_insn_args): Use position extracted by "+A" + to calculate size for "+B". Redo code for "+C" so it shares + the same style as "+A" and "+B" now do. + +2003-01-02 Chris Demetriou <cgd@broadcom.com> + * mips-dis.c: Update copyright years. (print_insn_arg): Rename to... (print_insn_args): This, returning void. Process the whole diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c index cbf87ce..176ffeb 100644 --- a/opcodes/mips-dis.c +++ b/opcodes/mips-dis.c @@ -672,6 +672,9 @@ print_insn_args (d, l, pc, info) struct disassemble_info *info; { int op, delta; + unsigned int lsb, msb, msbd; + + lsb = 0; for (; *d != '\0'; d++) { @@ -697,21 +700,18 @@ print_insn_args (d, l, pc, info) return; case 'A': - (*info->fprintf_func) (info->stream, "0x%x", - (l >> OP_SH_SHAMT) & OP_MASK_SHAMT); + lsb = (l >> OP_SH_SHAMT) & OP_MASK_SHAMT; + (*info->fprintf_func) (info->stream, "0x%x", lsb); break; case 'B': - (*info->fprintf_func) (info->stream, "0x%x", - (((l >> OP_SH_INSMSB) & OP_MASK_INSMSB) - - ((l >> OP_SH_SHAMT) & OP_MASK_SHAMT) - + 1)); + msb = (l >> OP_SH_INSMSB) & OP_MASK_INSMSB; + (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1); break; case 'C': - (*info->fprintf_func) (info->stream, "0x%x", - (((l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD) - + 1)); + msbd = (l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD; + (*info->fprintf_func) (info->stream, "0x%x", msbd + 1); break; case 'D': |