set up
This commit is contained in:
24
src/main.c
Normal file
24
src/main.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include "vmbl.h"
|
||||
|
||||
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]));
|
||||
|
||||
VMBL_Instruction program[] = {
|
||||
MAKE_INST_PUSH(69),
|
||||
MAKE_INST_PUSH(420),
|
||||
MAKE_INST_ADD,
|
||||
};
|
||||
|
||||
int main() {
|
||||
VMBL_State vmblState = {};
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(program) i++) {
|
||||
VMBL_Exception exception = VBML_ExecuteInstruction(&vmblState, program[i]);
|
||||
if (exception.type != EXCEPTION_NONE) {
|
||||
VMBL_Dump(vmblState, exception);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user