debug log new PC address after trap
This commit is contained in:
parent
5ac576a0ac
commit
b3fd4994a8
1 changed files with 8 additions and 8 deletions
16
cpu.cpp
16
cpu.cpp
|
@ -1104,18 +1104,18 @@ void cpu::busError()
|
||||||
{
|
{
|
||||||
fprintf(stderr, "BUS ERROR\n");
|
fprintf(stderr, "BUS ERROR\n");
|
||||||
|
|
||||||
// PSW = 177776
|
trap(4);
|
||||||
// mov @#PSW, -(sp)
|
}
|
||||||
pushStack(getPSW());
|
|
||||||
|
|
||||||
// mov pc, -(sp)
|
void cpu::trap(const uint16_t vector)
|
||||||
|
{
|
||||||
|
pushStack(getPSW());
|
||||||
pushStack(getPC());
|
pushStack(getPC());
|
||||||
|
|
||||||
// mov @#VEC+2, @#PSW
|
setPSW(b->readWord(vector + 2));
|
||||||
setPSW(b -> readWord(6));
|
setPC (b->readWord(vector + 0));
|
||||||
|
|
||||||
// mov @#VEC, pc
|
fprintf(stderr, "TRAP %o: PC is now %06o\n", vector, getPC());
|
||||||
setPC(b -> readWord(4));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<std::string, int> cpu::addressing_to_string(const uint8_t mode_register, const uint16_t pc)
|
std::pair<std::string, int> cpu::addressing_to_string(const uint8_t mode_register, const uint16_t pc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue