25 lines
543 B
C
25 lines
543 B
C
#include "../../debug.h"
|
|
#include "../../test.h"
|
|
#include "../../vm.h"
|
|
#include <emscripten.h>
|
|
|
|
VM vm = {0};
|
|
|
|
void mainloop() {
|
|
if (!step_vm(&vm)) {
|
|
emscripten_cancel_main_loop(); /* this should "kill" the app. */
|
|
}
|
|
}
|
|
|
|
int main(int argc, char **argv) {
|
|
vm.frames_size = FRAMES_SIZE;
|
|
vm.return_stack_size = STACK_SIZE;
|
|
vm.stack_size = STACK_SIZE;
|
|
vm.memory_size = MEMORY_SIZE;
|
|
|
|
test_add_function_compile(vm.memory);
|
|
/* test_recursive_function_compile(vm.memory); */
|
|
emscripten_set_main_loop(mainloop, 0, 1);
|
|
return 0;
|
|
}
|