aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.h
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-16 12:45:50 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-16 12:55:19 +0100
commit266b4e4572be015dca986b423896ec6fa14b4318 (patch)
tree7218426e1463d0102055dd6b64da67ca0947d65e /src/runtime.h
parent44f8c81efeabb4576be427e7d53e982848cb5be9 (diff)
downloadovm-266b4e4572be015dca986b423896ec6fa14b4318.tar.gz
ovm-266b4e4572be015dca986b423896ec6fa14b4318.tar.bz2
ovm-266b4e4572be015dca986b423896ec6fa14b4318.zip
Implemented vm_print_* routines
Prints each aspect of the vm, and vm_print_all does it all.
Diffstat (limited to 'src/runtime.h')
-rw-r--r--src/runtime.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/runtime.h b/src/runtime.h
index 5505fc0..f512992 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -13,6 +13,7 @@
#ifndef RUNTIME_H
#define RUNTIME_H
+#include <stdio.h>
#include <stdlib.h>
#include "./base.h"
@@ -42,10 +43,17 @@ typedef struct
} program;
} vm_t;
+void vm_execute(vm_t *);
+
void vm_load_stack(vm_t *, byte *, size_t);
void vm_load_program(vm_t *, inst_t *, size_t);
-void vm_execute(vm_t *);
+// Print routines
+void vm_print_registers(vm_t *, FILE *);
+void vm_print_stack(vm_t *, FILE *);
+#define VM_PRINT_PROGRAM_EXCERPT 5
+void vm_print_program(vm_t *, FILE *);
+void vm_print_all(vm_t *, FILE *);
void vm_push_byte(vm_t *, data_t);
void vm_push_word(vm_t *, data_t);