minor perf improvement for byte writes in operandx (validated with timeit)

This commit is contained in:
Neil Webber 2024-05-14 09:04:38 -05:00
parent 837c691fdc
commit 02f55397f8

View file

@ -277,7 +277,7 @@ class PDP11:
# start off in halted state until .run() happens # start off in halted state until .run() happens
self.halted = True self.halted = True
# device instances; see add_device # device instances; see associate_device
self.devices = {} self.devices = {}
def physRW(self, physaddr, value=None): def physRW(self, physaddr, value=None):
@ -435,8 +435,7 @@ class PDP11:
case Rn, bv, 1: case Rn, bv, 1:
# NOTE: The MOVB instruction has different semantics # NOTE: The MOVB instruction has different semantics
# than this; it is coded explicitly in op11_movb() # than this; it is coded explicitly in op11_movb()
self.r[Rn] &= 0o177400 self.r[Rn] = (self.r[Rn] & 0o177400) | (bv & 0o377)
self.r[Rn] |= (bv & 0o377)
return (value, b6) if rmw else value return (value, b6) if rmw else value
# harder cases # harder cases