emualtor working
This commit is contained in:
@@ -47,6 +47,17 @@ class EmulatorAddressingTest(unittest.TestCase):
|
||||
self.assertEqual(emulator.cpu.regs[0], 0x00C7)
|
||||
self.assertEqual(emulator.cpu.pc, 0x1006)
|
||||
|
||||
def test_byte_immediate_to_word_destination_writes_zero_extended_word(self):
|
||||
rom = rom_with_reset()
|
||||
rom[0x1000:0x1005] = b"\x1D\xF8\x70\x06\xAB" # MOV:G.W #H'AB, @H'F870
|
||||
|
||||
emulator = H8536Emulator(bytes(rom))
|
||||
emulator.memory.write16(0xF870, 0xFFFF)
|
||||
emulator.step()
|
||||
|
||||
self.assertEqual(emulator.memory.read16(0xF870), 0x00AB)
|
||||
self.assertEqual(emulator.cpu.pc, 0x1005)
|
||||
|
||||
def test_signed_byte_displacement_addresses_below_base(self):
|
||||
rom = rom_with_reset()
|
||||
rom[0x1000:0x1003] = b"\xE1\xFE\x81" # MOV:G.B @(H'-02,R1), R1
|
||||
|
||||
Reference in New Issue
Block a user