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