diff options
author | Stan Shebs <shebs@codesourcery.com> | 1994-06-28 20:27:02 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1994-06-28 20:27:02 +0000 |
commit | fea3fe6407ef6bb3239c5ff8b91e89b66db45e33 (patch) | |
tree | 806c7dae1c293cf88accb0f8ac61c37969a5a8bb /opcodes/h8300-dis.c | |
parent | 22691fe7be208f8e82739c4d470d6e6ae85cfdf0 (diff) | |
download | gdb-fea3fe6407ef6bb3239c5ff8b91e89b66db45e33.zip gdb-fea3fe6407ef6bb3239c5ff8b91e89b66db45e33.tar.gz gdb-fea3fe6407ef6bb3239c5ff8b91e89b66db45e33.tar.bz2 |
* h8300-dis.c, mips-dis.c: Don't use true and false.
Diffstat (limited to 'opcodes/h8300-dis.c')
-rw-r--r-- | opcodes/h8300-dis.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/opcodes/h8300-dis.c b/opcodes/h8300-dis.c index c9d2353..4064158 100644 --- a/opcodes/h8300-dis.c +++ b/opcodes/h8300-dis.c @@ -93,10 +93,12 @@ bfd_h8_disassemble (addr, info, hmode) int rdisp = 0; int abs = 0; int plen = 0; - static boolean init; + static boolean init = 0; struct h8_opcode *q = h8_opcodes; char CONST **pregnames = hmode ? lregnames : wregnames; int status; + int l; + unsigned char data[20]; void *stream = info->stream; fprintf_ftype fprintf = info->fprintf_func; @@ -104,7 +106,7 @@ bfd_h8_disassemble (addr, info, hmode) if (!init) { bfd_h8_disassemble_init (); - init = true; + init = 1; } status = info->read_memory_func(addr, data, 2, info); @@ -113,8 +115,11 @@ bfd_h8_disassemble (addr, info, hmode) info->memory_error_func(status, addr, info); return -1; } - status = info->read_memory_func(addr, data+2, 8, info); - + for (l = 2; status == 0 && l < 10; l+=2) + { + status = info->read_memory_func(addr+l, data+l, 2, info); + } + /* Find the exact opcode/arg combo */ @@ -132,7 +137,7 @@ bfd_h8_disassemble (addr, info, hmode) thisnib = (len & 1) ? (thisnib & 0xf) : ((thisnib >> 4) & 0xf); - if (looking_for < 16) + if (looking_for < 16 && looking_for >=0) { if (looking_for != thisnib) @@ -185,7 +190,10 @@ bfd_h8_disassemble (addr, info, hmode) | (data[2] << 8) | (data[3]); } - + else if(looking_for & MEMIND) + { + abs = data[1]; + } else if (looking_for & L_32) { int i = len >> 1; @@ -318,6 +326,8 @@ bfd_h8_disassemble (addr, info, hmode) else if (x & PCREL) { + if (x & L_16) + abs +=2; fprintf (stream, ".%s%d (%x)", (char) abs > 0 ? "+" : "", (char) abs, addr + (char) abs + 2); } |