aboutsummaryrefslogtreecommitdiff
path: root/vm/runtime.h
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-03 19:09:13 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-03 19:09:13 +0000
commita7588ccc6166d1fa49a37db6d2d3aba552901e9e (patch)
tree560f4230f07d6ac7c0b5730394d9998c9534d155 /vm/runtime.h
parentfe7f26256b5da63e46d3e36a8ddfe119dc9095b4 (diff)
downloadovm-a7588ccc6166d1fa49a37db6d2d3aba552901e9e.tar.gz
ovm-a7588ccc6166d1fa49a37db6d2d3aba552901e9e.tar.bz2
ovm-a7588ccc6166d1fa49a37db6d2d3aba552901e9e.zip
Use program structure for runtime
Very barebones, essentially a simple refactor. I need to introduce a feature to append to a program as well, but as it's a flexible structure it will likely have to be functional.
Diffstat (limited to 'vm/runtime.h')
-rw-r--r--vm/runtime.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm/runtime.h b/vm/runtime.h
index c98dfcf..7fd72b8 100644
--- a/vm/runtime.h
+++ b/vm/runtime.h
@@ -53,8 +53,8 @@ typedef struct
heap_t heap;
struct Program
{
- inst_t *instructions;
- size_t ptr, max;
+ prog_t *data;
+ word ptr;
} program;
struct CallStack
{
@@ -69,7 +69,7 @@ err_t vm_execute_all(vm_t *);
void vm_load_stack(vm_t *, byte *, size_t);
void vm_load_registers(vm_t *, registers_t);
void vm_load_heap(vm_t *, heap_t);
-void vm_load_program(vm_t *, inst_t *, size_t);
+void vm_load_program(vm_t *, prog_t *);
void vm_load_call_stack(vm_t *, word *, size_t);
void vm_stop(vm_t *);