Add debug print

This commit is contained in:
Juhani Krekelä 2021-07-10 02:21:36 +03:00
parent c360c96b69
commit 1e6ab47f40
1 changed files with 6 additions and 2 deletions

View File

@ -116,8 +116,12 @@ def step():
# 0nnn call_machine
elif high_byte >> 4 == 0:
print("%03x: Can't call machine language!" % (ip - 2))
sys.exit(1)
# Our own non-standard debug
if high_byte & 0xf == 0x1:
print(low_byte & 0xf, data_registers[low_byte & 0xf])
else:
print("%03x: Can't call machine language!" % (ip - 2))
sys.exit(1)
# 1nnn jmp nnn
elif high_byte >> 4 == 1: