37 lines
534 B
C
37 lines
534 B
C
#include "../../../vm/vm.h"
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#define CODE_SIZE 8192
|
|
#define MEMORY_SIZE 65536
|
|
u8 lmem[MEMORY_SIZE] = {0};
|
|
u32 lcode[CODE_SIZE] = {0};
|
|
|
|
bool init_vm() {
|
|
mem = lmem;
|
|
memset(mem, 0, MEMORY_SIZE*sizeof(u8));
|
|
code = lcode;
|
|
mp = 0;
|
|
cp = 0;
|
|
pc = 0;
|
|
interrupt = 0;
|
|
return true;
|
|
}
|
|
|
|
u32 syscall(u32 id, u32 args, u32 mem_ptr) {
|
|
USED(id);
|
|
USED(args);
|
|
USED(mem_ptr);
|
|
return 0; // success
|
|
}
|
|
|
|
i32 main() {
|
|
|
|
while(step_vm()) {
|
|
// do stuff
|
|
}
|
|
|
|
printf("done\n");
|
|
return 0;
|
|
}
|