From: khamidou Date: Tue, 18 Jan 2011 07:46:44 +0000 (+0100) Subject: jmp now works X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=a906b2839a1c18de8d550e2d5ff2c78777ad283e;p=miniforth.git jmp now works --- 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; }