diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-02-21 12:02:14 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-02-21 12:02:14 +0200 |
| commit | a0b4a1a6107e4dc905b21858d8ac76c47293cfb4 (patch) | |
| tree | f7ec4d592a6ee7bf6f1e61ef805643c83fedf740 /atk16_emu/test/test_opcode_hlt.py | |
| parent | 549901c85044b6ccd912688d6be007c2fdacc6c6 (diff) | |
Add emu
Diffstat (limited to 'atk16_emu/test/test_opcode_hlt.py')
| -rw-r--r-- | atk16_emu/test/test_opcode_hlt.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/atk16_emu/test/test_opcode_hlt.py b/atk16_emu/test/test_opcode_hlt.py new file mode 100644 index 0000000..5cae888 --- /dev/null +++ b/atk16_emu/test/test_opcode_hlt.py @@ -0,0 +1,18 @@ +from atk16_emu.emu import Machine +from atk16_emu.test.utils import make_rom + +def test_hlt(): + machine = Machine() + + rom_image = make_rom([0b1111_0000_0000_0000]) # HLT + machine.load_rom_image(rom_image) + machine.reset() + machine.run() + + assert machine.pc.value == 0 + assert machine.running == True + + machine.step() + + assert machine.pc.value == 1 + assert machine.running == False |
