disassemble: for first line show registers

This commit is contained in:
folkert van heusden 2022-04-12 11:21:59 +02:00
parent 44ad6a5912
commit 0ffb8ab7c4

View file

@ -124,8 +124,13 @@ void debugger(console *const cnsl, bus *const b, std::atomic_bool *const interru
int pc = kv.find("pc") != kv.end() ? std::stoi(kv.find("pc")->second, nullptr, 8) : c->getPC(); int pc = kv.find("pc") != kv.end() ? std::stoi(kv.find("pc")->second, nullptr, 8) : c->getPC();
int n = kv.find("n") != kv.end() ? std::stoi(kv.find("n") ->second, nullptr, 10) : 1; int n = kv.find("n") != kv.end() ? std::stoi(kv.find("n") ->second, nullptr, 10) : 1;
for(int i=0; i<n; i++) bool show_registers = kv.find("pc") == kv.end();
pc += disassemble(c, cnsl, pc, true);
for(int i=0; i<n; i++) {
pc += disassemble(c, cnsl, pc, !show_registers);
show_registers = false;
}
continue; continue;
} }