log SP of each run mode
This commit is contained in:
parent
19a733be0d
commit
5b38f238e8
2 changed files with 15 additions and 2 deletions
11
cpu.cpp
11
cpu.cpp
|
@ -796,7 +796,7 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
set_flags = putGAM(g_dst, r);
|
set_flags = putGAM(g_dst, r);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
auto g_dst = getGAM(dst_mode, dst_reg, word_mode, false, false);
|
auto g_dst = getGAM(dst_mode, dst_reg, word_mode, false, false);
|
||||||
|
|
||||||
set_flags = putGAM(g_dst, 0);
|
set_flags = putGAM(g_dst, 0);
|
||||||
}
|
}
|
||||||
|
@ -2124,6 +2124,13 @@ std::map<std::string, std::vector<std::string> > cpu::disassemble(const uint16_t
|
||||||
|
|
||||||
out.insert({ "registers", registers });
|
out.insert({ "registers", registers });
|
||||||
|
|
||||||
|
std::vector<std::string> registers_sp;
|
||||||
|
|
||||||
|
for(int i=0; i<4; i++)
|
||||||
|
registers_sp.push_back(format("%06o", sp[i]));
|
||||||
|
|
||||||
|
out.insert({ "sp", registers_sp });
|
||||||
|
|
||||||
// PSW
|
// PSW
|
||||||
std::string psw_str = format("%d%d|%d|%d|%c%c%c%c%c", psw >> 14, (psw >> 12) & 3, (psw >> 11) & 1, (psw >> 5) & 7,
|
std::string psw_str = format("%d%d|%d|%d|%c%c%c%c%c", psw >> 14, (psw >> 12) & 3, (psw >> 11) & 1, (psw >> 5) & 7,
|
||||||
psw & 16?'t':'-', psw & 8?'n':'-', psw & 4?'z':'-', psw & 2 ? 'v':'-', psw & 1 ? 'c':'-');
|
psw & 16?'t':'-', psw & 8?'n':'-', psw & 4?'z':'-', psw & 2 ? 'v':'-', psw & 1 ? 'c':'-');
|
||||||
|
@ -2179,7 +2186,7 @@ void cpu::step_b()
|
||||||
|
|
||||||
DOLOG(warning, true, "UNHANDLED instruction %06o @ %06o", instr, temp_pc);
|
DOLOG(warning, true, "UNHANDLED instruction %06o @ %06o", instr, temp_pc);
|
||||||
|
|
||||||
// trap(010); floating point nog niet geimplementeerd
|
trap(010); // floating point nog niet geimplementeerd
|
||||||
}
|
}
|
||||||
catch(const int exception) {
|
catch(const int exception) {
|
||||||
DOLOG(debug, true, "bus-trap during execution of command (%d)", exception);
|
DOLOG(debug, true, "bus-trap during execution of command (%d)", exception);
|
||||||
|
|
|
@ -76,6 +76,12 @@ int disassemble(cpu *const c, console *const cnsl, const int pc, const bool inst
|
||||||
else
|
else
|
||||||
DOLOG(debug, true, "%s", result.c_str());
|
DOLOG(debug, true, "%s", result.c_str());
|
||||||
|
|
||||||
|
std::string sp;
|
||||||
|
for(auto sp_val : data["sp"])
|
||||||
|
sp += (sp.empty() ? "" : ",") + sp_val;
|
||||||
|
|
||||||
|
DOLOG(debug, true, "SP: %s", sp.c_str());
|
||||||
|
|
||||||
return data["instruction-values"].size() * 2;
|
return data["instruction-values"].size() * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue