HALT in user mode is ReservedInst, not AddressError

This commit is contained in:
Neil Webber 2024-05-16 15:39:44 -05:00
parent d0de30614f
commit 4651d137f7

View file

@ -29,8 +29,10 @@ from branches import branch
def op_halt(cpu, inst): def op_halt(cpu, inst):
if cpu.psw_curmode != cpu.KERNEL: if cpu.psw_curmode != cpu.KERNEL:
# strange trap, but that's what it says # In the 1979 PDP-11/70 handbook it says trap 4 for non-kernel HALT.
raise PDPTraps.AddressError(cpu.CPUERR_BITS.ILLHALT) # An 11/40 book says trap 10 (ReservedInst, makes more sense).
# SIMH says trap 10. Going with that.
raise PDPTraps.ReservedInstruction(cpu.CPUERR_BITS.ILLHALT)
cpu.halted = True cpu.halted = True