From d2cdb211b2d15c3a15b15737645f2a68641f34ee Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sat, 21 Oct 2023 23:31:48 +0100 Subject: Added vm_execute_all which executes an entire program Handles OP_HALT --- src/main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 5298876..c99ffb8 100644 --- a/src/main.c +++ b/src/main.c @@ -28,13 +28,7 @@ int interpret_bytecode(const char *filepath) vm_t vm = {0}; vm_load_stack(&vm, stack, ARR_SIZE(stack)); vm_load_program(&vm, instructions, number); - for (size_t i = 0; i < number; ++i) - { - vm_execute(&vm); - printf("Cycle %lu\n", i); - vm_print_all(&vm, stdout); - printf("\n"); - } + vm_execute_all(&vm); free(instructions); return 0; } -- cgit v1.2.3-13-gbd6f