diff options
author | jjsuperpower <jjs29356@gmail.com> | 2022-10-13 21:04:09 -0500 |
---|---|---|
committer | jjsuperpower <jjs29356@gmail.com> | 2022-10-13 21:04:09 -0500 |
commit | 543d0c1a5fcc68b6c7778cd86e544d6d1261d6d6 (patch) | |
tree | 128489e8c841f11ce7717753ff97ecc9ecb9ef6a /hdl/core | |
parent | bcb5a08e1ebd3e5ef5395bd6fd685c0ace7fa748 (diff) |
started op codes file
Diffstat (limited to 'hdl/core')
-rw-r--r-- | hdl/core/opcodes.py | 52 |
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 + + |