From bee6d445bb227f788eb584b0943233613e0d2770 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 15 Oct 2023 05:40:53 +0100 Subject: Added a routine to load a pointer as stack memory --- src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index df596a7..3d878b3 100644 --- a/src/main.c +++ b/src/main.c @@ -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) -- cgit v1.2.3-13-gbd6f