From a0b4a1a6107e4dc905b21858d8ac76c47293cfb4 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 21 Feb 2024 12:02:14 +0200 Subject: Add emu --- atk16_emu/opcodes.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 atk16_emu/opcodes.py (limited to 'atk16_emu/opcodes.py') diff --git a/atk16_emu/opcodes.py b/atk16_emu/opcodes.py new file mode 100644 index 0000000..268c873 --- /dev/null +++ b/atk16_emu/opcodes.py @@ -0,0 +1,38 @@ +from typing import Literal +from dataclasses import dataclass + +Opcode = Literal[ + "ALR", + "ALI", + "LDR", + "STR", + "LDI", + "JPR", + "JPI", + "BRR", + "BRI", + "LPC", + "NOP", + "ISRP0", + "ISRP1", + "RTI", + "HLT", +] + +@dataclass +class ALR(): + target: int + left: int + right: int + alu_code: int + +@dataclass +class ALI(): + target: int + left: int + imm: int + alu_code: int + +@dataclass +class HLT(): + pass -- cgit v1.3