diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 21:45:47 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 21:45:47 +0000 |
commit | cb1cfde0c44b059bdae147475bcde5cccac2a4e5 (patch) | |
tree | c8617b364d836131778733553384bf015c5227a4 /lib/inst.h | |
parent | 75649381132924c4cb5e4fa215e200e2457a1434 (diff) | |
download | ovm-cb1cfde0c44b059bdae147475bcde5cccac2a4e5.tar.gz ovm-cb1cfde0c44b059bdae147475bcde5cccac2a4e5.tar.bz2 ovm-cb1cfde0c44b059bdae147475bcde5cccac2a4e5.zip |
Added instruction to get the size of some allocation
This will allow for more library level code to be written. For
example, say you wanted to write a generic byte level reversal
algorithm for dynamically sized allocations. Getting the size of the
allocation would be fundamental to this operation.
Diffstat (limited to 'lib/inst.h')
-rw-r--r-- | lib/inst.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -55,6 +55,7 @@ typedef enum OP_MGET_HWORD, OP_MGET_WORD, OP_MDELETE, + OP_MSIZE, // Boolean operations OP_NOT_BYTE, @@ -189,6 +190,7 @@ inst_t *insts_read_bytecode_file(FILE *, size_t *); #define INST_MGET(TYPE, OP) \ ((inst_t){.opcode = OP_MGET_##TYPE, .operand = DWORD(OP)}) #define INST_MDELETE ((inst_t){.opcode = OP_MDELETE}) +#define INST_MSIZE ((inst_t){.opcode = OP_MSIZE}) #define INST_NOT(TYPE) ((inst_t){.opcode = OP_NOT_##TYPE}) #define INST_OR(TYPE) ((inst_t){.opcode = OP_OR_##TYPE}) |