aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-15 01:35:05 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-15 01:35:05 +0100
commit1101716f0f1461b5fc1115a55c3b5bb7e06cf133 (patch)
tree1e402156b3da803e221cf8106d05f4cf9f6b4449
parentca2e9c7083347366402991531d236f35d6726450 (diff)
downloadovm-1101716f0f1461b5fc1115a55c3b5bb7e06cf133.tar.gz
ovm-1101716f0f1461b5fc1115a55c3b5bb7e06cf133.tar.bz2
ovm-1101716f0f1461b5fc1115a55c3b5bb7e06cf133.zip
Defined a simple virtual machine data structure
Currently just contains a "stack".
-rw-r--r--src/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index cd66ebb..6f468cb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,6 +23,17 @@ typedef double f64;
typedef uint8_t byte;
typedef u64 word;
+#define VM_STACK_MAX 1024
+
+typedef struct
+{
+ struct Stack
+ {
+ byte data[VM_STACK_MAX];
+ word pointer;
+ } stack;
+} vm_t;
+
int main(void)
{
puts("Hello, world!");