Added functionality to read and write instruction bytecode
Uses some bit hacks to quickly check what data type an opcode may have by shifting down to units then casting it to a data_type_t. Not very well tested yet, we'll need to see now.
This commit is contained in:
@@ -35,6 +35,14 @@ typedef union
|
||||
f64 as_float;
|
||||
} data_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DATA_TYPE_NIL = 0,
|
||||
DATA_TYPE_BYTE = 1,
|
||||
DATA_TYPE_WORD = 3,
|
||||
DATA_TYPE_FLOAT = 5,
|
||||
} data_type_t;
|
||||
|
||||
#define DBYTE(BYTE) ((data_t){.as_byte = (BYTE)})
|
||||
#define DWORD(WORD) ((data_t){.as_word = (WORD)})
|
||||
#define DFLOAT(FLOAT) ((data_t){.as_float = (FLOAT)})
|
||||
|
||||
Reference in New Issue
Block a user