missing import and fix _shifter when NN=0 per 1981 book. Issue Misc #10

This commit is contained in:
Neil Webber 2024-04-01 07:56:22 -05:00
parent 3a7d68bad1
commit 7fd5b507d5

View file

@ -34,6 +34,8 @@
# op076 is the commercial instruction set # op076 is the commercial instruction set
# #
from pdptraps import PDPTraps
def op070_mul(cpu, inst): def op070_mul(cpu, inst):
dstreg = (inst & 0o000700) >> 6 dstreg = (inst & 0o000700) >> 6
@ -152,7 +154,7 @@ def _shifter(cpu, value, shift, *, opsize):
cpu.psw_n = vsign cpu.psw_n = vsign
cpu.psw_z = (value == 0) cpu.psw_z = (value == 0)
cpu.psw_v = 0 cpu.psw_v = 0
# C is not altered cpu.psw_c = 0 # per 1981 PDP11 Processor Handbook
return value return value
elif shift > 31: # right shift elif shift > 31: # right shift
# sign extend if appropriate, so the sign propagates # sign extend if appropriate, so the sign propagates