setreg / setpsw
This commit is contained in:
parent
27b8aa490e
commit
7003953e42
1 changed files with 39 additions and 10 deletions
49
debugger.cpp
49
debugger.cpp
|
@ -830,19 +830,29 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (parts[0] == "toggle") {
|
else if (parts[0] == "setreg") {
|
||||||
auto s_it = kv.find("s");
|
if (parts.size() == 3) {
|
||||||
auto t_it = kv.find("t");
|
int reg = std::stoi(parts.at(1));
|
||||||
|
uint16_t val = std::stoi(parts.at(2), nullptr, 8);
|
||||||
|
c->set_register(reg, val);
|
||||||
|
|
||||||
if (s_it == kv.end() || t_it == kv.end())
|
cnsl->put_string_lf(format("Set register %d to %06o", reg, val));
|
||||||
cnsl->put_string_lf(format("toggle: parameter missing? current switches states: 0o%06o", c->getBus()->get_console_switches()));
|
}
|
||||||
else {
|
else {
|
||||||
int s = std::stoi(s_it->second, nullptr, 8);
|
cnsl->put_string_lf("setreg requires a register and an octal value");
|
||||||
int t = std::stoi(t_it->second, nullptr, 8);
|
}
|
||||||
|
|
||||||
c->getBus()->set_console_switch(s, t);
|
continue;
|
||||||
|
}
|
||||||
|
else if (parts[0] == "setpsw") {
|
||||||
|
if (parts.size() == 2) {
|
||||||
|
uint16_t val = std::stoi(parts.at(1), nullptr, 8);
|
||||||
|
c->lowlevel_psw_set(val);
|
||||||
|
|
||||||
cnsl->put_string_lf(format("Set switch %d to %d", s, t));
|
cnsl->put_string_lf(format("Set PSW to %06o", val));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cnsl->put_string_lf("setpsw requires an octal value");
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -864,6 +874,23 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (parts[0] == "toggle") {
|
||||||
|
auto s_it = kv.find("s");
|
||||||
|
auto t_it = kv.find("t");
|
||||||
|
|
||||||
|
if (s_it == kv.end() || t_it == kv.end())
|
||||||
|
cnsl->put_string_lf(format("toggle: parameter missing? current switches states: 0o%06o", c->getBus()->get_console_switches()));
|
||||||
|
else {
|
||||||
|
int s = std::stoi(s_it->second, nullptr, 8);
|
||||||
|
int t = std::stoi(t_it->second, nullptr, 8);
|
||||||
|
|
||||||
|
c->getBus()->set_console_switch(s, t);
|
||||||
|
|
||||||
|
cnsl->put_string_lf(format("Set switch %d to %d", s, t));
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (parts[0] == "trace" || parts[0] == "t") {
|
else if (parts[0] == "trace" || parts[0] == "t") {
|
||||||
settrace(!gettrace());
|
settrace(!gettrace());
|
||||||
|
|
||||||
|
@ -1221,7 +1248,9 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
||||||
"state x - dump state of a device: rl02, rk05, rp06, mmu, tm11, kw11l or dc11",
|
"state x - dump state of a device: rl02, rk05, rp06, mmu, tm11, kw11l or dc11",
|
||||||
"mmures x - resolve a virtual address",
|
"mmures x - resolve a virtual address",
|
||||||
"qi - show queued interrupts",
|
"qi - show queued interrupts",
|
||||||
"setpc x - set PC to value",
|
"setpc x - set PC to value (octal)",
|
||||||
|
"setreg x y - set register x to value y (octal)",
|
||||||
|
"setpsw x - set PSW value y (octal)",
|
||||||
"setmem ... - set memory (a=) to value (v=), both in octal, one byte",
|
"setmem ... - set memory (a=) to value (v=), both in octal, one byte",
|
||||||
"toggle ... - set switch (s=, 0...15 (decimal)) of the front panel to state (t=, 0 or 1)",
|
"toggle ... - set switch (s=, 0...15 (decimal)) of the front panel to state (t=, 0 or 1)",
|
||||||
"setinthz x - set KW11-L interrupt frequency (Hz)",
|
"setinthz x - set KW11-L interrupt frequency (Hz)",
|
||||||
|
|
Loading…
Add table
Reference in a new issue