1 #ifndef SUN_VM_INSTRUCTION_H
2 #define SUN_VM_INSTRUCTION_H
7 #include <sun/vm/fixed.h>
49 typedef enum SVMOpcode SVMOpcode
;
51 extern const char *svmOpcodeToString(SVMOpcode opcode
);
53 typedef int32_t SVMStackOffset
;
54 typedef Fixed
/*float*/ SVMFloat
;
55 typedef Fixed
/*int32_t*/ SVMInteger
;
56 typedef uint32_t SVMPointer
;
59 SVMStackOffset stackOffset
;
60 SVMFloat floatLiteral
;
61 SVMInteger integerLiteral
;
62 SVMPointer pointerLiteral
; // Strings, function pointer
65 typedef union SVMOperand SVMOperand
;
67 struct SVMInstruction
{
69 union __attribute__((__packed__
)) {
70 struct __attribute__((__packed__
)) {
76 SVMOperand operands
[3];
79 typedef struct SVMInstruction SVMInstruction
;