VM runtime now maintains a heap internally
Now need to create some instructions which manage the heap
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <lib/heap.h>
|
||||
#include <lib/inst.h>
|
||||
|
||||
typedef enum
|
||||
@@ -45,6 +46,7 @@ typedef struct
|
||||
byte *data;
|
||||
word ptr, max;
|
||||
} stack;
|
||||
heap_t heap;
|
||||
struct Program
|
||||
{
|
||||
inst_t *instructions;
|
||||
@@ -56,8 +58,9 @@ err_t vm_execute(vm_t *);
|
||||
err_t vm_execute_all(vm_t *);
|
||||
|
||||
void vm_load_stack(vm_t *, byte *, size_t);
|
||||
void vm_load_program(vm_t *, inst_t *, 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_stop(vm_t *);
|
||||
|
||||
// Print routines
|
||||
|
||||
Reference in New Issue
Block a user