From a906b2839a1c18de8d550e2d5ff2c78777ad283e Mon Sep 17 00:00:00 2001 From: khamidou Date: Tue, 18 Jan 2011 08:46:44 +0100 Subject: [PATCH] jmp now works --- tests/t4.as | 2 ++ vm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/t4.as b/tests/t4.as index 2b46652..e07085c 100644 --- a/tests/t4.as +++ b/tests/t4.as @@ -1,4 +1,6 @@ push 23 +dprint jmp t push 24 +dprint t: dprint diff --git a/vm.c b/vm.c index 7115e68..5fb06f5 100644 --- a/vm.c +++ b/vm.c @@ -81,7 +81,7 @@ int run(struct vm *v) case JMP: ip++; - ip = v->stack + (*ip); + ip = v->mem + (*ip) - 1; /* because the pointer gets automatically incremented */ break; } -- 2.43.0