summaryrefslogtreecommitdiff
path: root/instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'instruction.h')
-rw-r--r--instruction.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/instruction.h b/instruction.h
index f53c995..1053936 100644
--- a/instruction.h
+++ b/instruction.h
@@ -37,7 +37,7 @@ struct r_type {
union {
uint16_t opx11:11;
struct {
- uint8_t n:5;
+ uint8_t imm5:5;
uint8_t opx6:6;
} __packed;
} opx;
@@ -196,9 +196,13 @@ enum {
};
#define R_TYPE_COUNT 0x40
-#define INSTR_ERR -1
-#define PC_INC_NORMAL 0
-#define PC_INC_BY_INSTR 1
+/*
+ * Return values for instruction handlers
+ */
+#define INSTR_ERR -1 /* Error in instruction */
+#define PC_INC_NORMAL 0 /* Normal PC increment after instruction */
+#define PC_INC_BY_INSTR 1 /* PC got incremented by instruction */
+#define INSTR_EXECPTION 2 /* Instruction generated an exception */
/* Forward declaration */
struct nios2;
@@ -206,5 +210,6 @@ struct nios2;
typedef int (*instruction_handler)(struct nios2 *cpu, uint32_t opcode);
extern instruction_handler instruction_get_handler(uint32_t code);
+extern const char *instruction_get_string(uint32_t code);
#endif /* _INSTRUCTION_H_ */