mirror of
https://github.com/mrkite/regs.git
synced 2024-12-29 04:29:29 +00:00
added hex back in
This commit is contained in:
parent
97380c589b
commit
b48d9185f7
@ -7,7 +7,7 @@
|
||||
#include "api.h"
|
||||
#include "iigs.h"
|
||||
|
||||
const char *argp_program_version = "regs 0.2";
|
||||
const char *argp_program_version = "regs 1.1";
|
||||
const char *argp_program_bug_address = "sean@seancode.com";
|
||||
static char doc[] = "Disassemble Apple IIgs software";
|
||||
static char args_doc[] = "FILE";
|
||||
|
@ -188,7 +188,19 @@ bool Scanner::disassemble(std::ostream &f, uint32_t from, uint32_t to,
|
||||
if (!sym.empty()) {
|
||||
f << sym << std::endl;
|
||||
}
|
||||
f << hex(address, 6) << ": " << printInst(map[address]) << std::endl;
|
||||
f << hex(address, 6) << ": ";
|
||||
auto ptr = getAddress(address);
|
||||
if (map[address]->length > 4) {
|
||||
f << ".. .. .. .. ";
|
||||
} else {
|
||||
for (int i = 0; i < map[address]->length; i++) {
|
||||
f << hex(ptr->r8(), 2) << " ";
|
||||
}
|
||||
for (int i = map[address]->length; i < 4; i++) {
|
||||
f << " ";
|
||||
}
|
||||
}
|
||||
f << printInst(map[address]) << std::endl;
|
||||
address += map[address]->length;
|
||||
}
|
||||
if (address < b->address + b->length) {
|
||||
@ -218,7 +230,7 @@ void Scanner::dumpHex(std::ostream &f, uint32_t from, uint32_t to) {
|
||||
f << " ";
|
||||
ascii += " ";
|
||||
}
|
||||
for (; j < 16 && !ptr->eof(); j++) {
|
||||
for (; j < 16 && !ptr->eof() && i + j - skip < len; j++) {
|
||||
if (j == 8) {
|
||||
f << " ";
|
||||
ascii += " ";
|
||||
|
Loading…
Reference in New Issue
Block a user