command advance sweep
This commit is contained in:
@@ -176,6 +176,21 @@ class EmulatorHarnessTest(unittest.TestCase):
|
||||
|
||||
self.assertEqual(emulator.memory.read8(ON_CHIP_RAM_START), 0x99)
|
||||
|
||||
def test_memory_access_log_records_executing_pc(self):
|
||||
rom = rom_with_reset(size=0x1010)
|
||||
rom[0x1000:0x1005] = bytes([0x15, (ON_CHIP_RAM_START >> 8) & 0xFF, ON_CHIP_RAM_START & 0xFF, 0x06, 0x77])
|
||||
|
||||
emulator = H8536Emulator(bytes(rom))
|
||||
emulator.run(max_steps=1)
|
||||
|
||||
writes = [
|
||||
access
|
||||
for access in emulator.memory.access_log
|
||||
if access.kind == "write" and access.address == ON_CHIP_RAM_START
|
||||
]
|
||||
self.assertEqual(writes[-1].value, 0x77)
|
||||
self.assertEqual(writes[-1].pc, 0x1000)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user