Files
VMBL/src/main.c

23 lines
452 B
C
Raw Normal View History

2025-12-19 18:31:41 +11:00
#include "vmbl.h"
#include <stdio.h>
2025-12-19 18:31:41 +11:00
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]));
VMBL_Instruction program[] = {
2025-12-21 09:44:16 +11:00
MAKE_INST_PUSH(0),
MAKE_INST_PUSH(1),
MAKE_INST_DUP(1),
MAKE_INST_DUP(1),
MAKE_INST_ADD,
MAKE_INST_JMP(2)
2025-12-19 18:31:41 +11:00
};
int main() {
2025-12-21 09:44:16 +11:00
VMBL_State vmblState = {};
2025-12-19 18:31:41 +11:00
2025-12-21 09:44:16 +11:00
VMBL_LoadExecutable(&vmblState, program, sizeof(program));
2025-12-22 13:25:21 +11:00
VMBL_SaveExecutable("fib.vmbl", program, sizeof(program));
2025-12-21 09:44:16 +11:00
VMBL_StartVM(&vmblState);
2025-12-19 18:31:41 +11:00
return 0;
}