1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Fixed bug in Memory autoinc handling

This commit is contained in:
Ross Wilson
2015-06-21 19:53:16 +07:00
parent bd37a8aa4c
commit 9645eda74c

View File

@@ -201,14 +201,15 @@ class Memory(object):
# the Imlac can get into infinite defer loops, and so can we!
while indirect:
address = address & (MEMORY_SIZE - 1)
address = MASK_MEM(address)
# if indirect on auto-inc register, add one to it before use
if ISAUTOINC(address):
# indirect on auto-inc register, add one to it before use
self.memory[address] = MASK_MEM(self.memory[address] + 1)
address = self.memory[address]
self.memory[address] += 1
address = self.memory[MASK_MEM(address)]
indirect = bool(address & 0100000)
return self.memory[address]
return self.memory[MASK_MEM(address)]
def eff_address(self, address, indirect):
"""Get an effective memory address.