summaryrefslogtreecommitdiff
path: root/hdl/core
diff options
context:
space:
mode:
Diffstat (limited to 'hdl/core')
-rw-r--r--hdl/core/opcodes.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/hdl/core/opcodes.py b/hdl/core/opcodes.py
new file mode 100644
index 0000000..09c5d2c
--- /dev/null
+++ b/hdl/core/opcodes.py
@@ -0,0 +1,52 @@
+from ctypes.wintypes import INT
+from enum import unique, Enum
+from http.client import MULTI_STATUS
+
+
+@unique
+class OpCodes(Enum):
+
+ # R-type
+ NOP = 0x00
+ ADD = 0x01
+ SUB = 0x02
+ XOR = 0x03
+ OR = 0x04
+ AND = 0x05
+ LSL = 0x06
+ LSR = 0x07
+ ASR = 0x08
+ MUL = 0x09
+ MULU = 0x0A
+ DIV = 0x0B # not implemented yet
+ DIVU = 0x0C # not implemented yet
+
+ # I-type
+ ADDI = 0x40
+ SUBI = 0x41
+ XORI = 0x42
+ ORI = 0x43
+ ANDI = 0x44
+ LSLI = 0x45
+ LSRI = 0x46
+ ASRI = 0x47
+ MULI = 0x48
+ MULUI = 0x49
+ DIVI = 0x4A # not implemented yet
+ DIVUI = 0x4B # not implemented yet
+
+ # J-type
+ JMP = 0x80
+ JMPI = 0x81
+
+ # C-type (control), 2 MSB -> System mode only
+ CALL = 0xA0
+ RET = 0xA1
+ SCALL = 0xA2
+
+ # ------------------ System mode only ------------------
+ INT = 0xC0
+ IRET = 0xC1
+ INVP = 0xC2
+
+