This commit is contained in:
SpookyDervish
2025-12-19 18:31:41 +11:00
parent 9f58ac9de5
commit f97ef75445
5 changed files with 150 additions and 0 deletions

24
src/main.c Normal file
View 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;
}