Refactor vm/main to use refactor to program structure

This commit is contained in:
2023-11-03 19:10:01 +00:00
parent a7588ccc61
commit 92f4f9011d
2 changed files with 6 additions and 7 deletions

View File

@@ -281,8 +281,8 @@ err_t vm_execute_all(vm_t *vm)
size_t prev_pages = 0;
size_t prev_cptr = 0;
#endif
while (program->data->instructions[program->ptr].opcode != OP_HALT &&
program->ptr < program->data->count)
while (program->ptr < program->data->count &&
program->data->instructions[program->ptr].opcode != OP_HALT)
{
#if VERBOSE >= 2
fprintf(stdout, "[vm_execute_all]: Trace(Cycle %lu)\n", cycles);