diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-15 05:40:53 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-15 05:40:53 +0100 |
commit | bee6d445bb227f788eb584b0943233613e0d2770 (patch) | |
tree | 6cf9b3a385233dd8c02bf02c8130f2a1549be4f2 /src/main.c | |
parent | 2de37b20e2904d09ff5337c8e0cc04c9fde5f38a (diff) | |
download | ovm-bee6d445bb227f788eb584b0943233613e0d2770.tar.gz ovm-bee6d445bb227f788eb584b0943233613e0d2770.tar.bz2 ovm-bee6d445bb227f788eb584b0943233613e0d2770.zip |
Added a routine to load a pointer as stack memory
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -24,6 +24,13 @@ typedef struct } stack; } vm_t; +void vm_load_stack(vm_t *vm, byte *bytes, size_t size) +{ + vm->stack.data = bytes; + vm->stack.size = size; + vm->stack.ptr = 0; +} + void vm_push_byte(vm_t *vm, data_t b) { if (vm->stack.ptr >= vm->stack.size) |