Files
VMBL/src/main.c

24 lines
478 B
C
Raw Normal View History

2025-12-19 18:31:41 +11:00
#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;
}