summaryrefslogtreecommitdiff
path: root/instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'instruction.h')
-rw-r--r--instruction.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/instruction.h b/instruction.h
index 7e1a490..323a66b 100644
--- a/instruction.h
+++ b/instruction.h
@@ -22,6 +22,13 @@ enum INST_TYPE {
#define MASK_INST_WITYPE (0x8000)
#define MASK_INST_JTYPE (0xC000)
+#define RTYPE_SIZE_BYTES 2 /* instruction fits in 16 bits */
+#define NITYPE_SIZE_BYTES 2 /* instruction fits in 16 bits */
+#define BTYPE_SIZE_BYTES 2 /* instruction fits in 16 bits */
+#define JRTYPE_SIZE_BYTES 2 /* instruction fits in 16 bits */
+#define WITYPE_SIZE_BYTES 4 /* 16-bit instruction + 16-bit immediate */
+#define JITYPE_SIZE_BYTES 4 /* 16-bit instruction + 16-bit immediate */
+
/**
* ALU operation types
* R-type and I-type take 3-bit ALU oper as bits: