about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-07-11 22:28:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-07-11 22:28:51 -0700
commitd17e8291efb5fb7c6f793ef925c6c262ce855581 (patch)
treec671e45336cae97d65a543c2cc8e3cc129d31327 /mu.arc
parent368e76cdf685e589f807755bdd39a31e8ccd2c83 (diff)
downloadmu-d17e8291efb5fb7c6f793ef925c6c262ce855581.tar.gz
20 - relative addressing for jumps
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc4
1 files changed, 2 insertions, 2 deletions
diff --git a/mu.arc b/mu.arc
index 765ccf4b..d0f83099 100644
--- a/mu.arc
+++ b/mu.arc
@@ -69,13 +69,13 @@
                 (= (memory* oarg.0.1)
                    (type* (otypes arg.0)))
               jmp
-                (do (= pc (- arg.0.1 1))  ; because continue still increments (bug)
+                (do (= pc (+ pc arg.0.1))  ; relies on continue still incrementing (bug)
 ;?                     (prn "jumping to " pc)
                     (continue))
               jifz
                 (when (is 0 (memory* arg.0.1))
 ;?                   (prn "jumping to " arg.1.1)
-                  (= pc (- arg.1.1 1))  ; because continue still increments (bug)
+                  (= pc (+ pc arg.1.1))  ; relies on continue still incrementing (bug)
                   (continue))
               reply
                 (do (= result arg)