squeeze a few nsec out of MOV

This commit is contained in:
Neil Webber 2024-05-23 18:14:23 -05:00
parent dbe374b4bf
commit 62150f45de

6
op4.py
View file

@ -68,9 +68,9 @@ def op01_mov(cpu, inst):
# avoid call to the more-general operandx for mode 0, direct register.
# This optimization is a substantial speed up for register MOVs.
srcb6 = (inst & 0o7700) >> 6
if srcb6 < 8:
val = cpu.r[srcb6]
else:
try:
val = cpu.r[srcb6] # only works if srcb6 < 8; register direct
except IndexError:
val = cpu.operandx(srcb6)
cpu.psw_v = 0 # per manual; V is cleared