asm: add instruction opcode/operand definition table

This commit is contained in:
2024-12-15 19:30:34 +00:00
parent 9e75e1f16f
commit 10c03c4b74
3 changed files with 75 additions and 10 deletions

View File

@@ -3,6 +3,26 @@
#include <ivy/opcode.h>
enum ivy_instr_operand_type {
IVY_OPERAND_NONE = 0,
IVY_INSTR_OPERAND_CONST,
IVY_INSTR_OPERAND_REGISTER,
IVY_INSTR_OPERAND_SELF_INDEX_REG,
IVY_INSTR_OPERAND_SELF_INDEX_CONST,
IVY_INSTR_OPERAND_POOL_INDEX_REG,
IVY_INSTR_OPERAND_POOL_INDEX_CONST,
IVY_INSTR_OPERAND_SP_INDEX_REG,
IVY_INSTR_OPERAND_SP_INDEX_CONST,
IVY_INSTR_OPERAND_BP_INDEX_REG,
IVY_INSTR_OPERAND_BP_INDEX_CONST,
};
struct ivy_instr_definition {
enum ivy_instr_id i_id;
enum ivy_opcopde i_opcode;
enum ivy_instr_operand_type i_operand[3];
};
struct ivy_instr {
enum ivy_opcode i_op;
long i_a0;