From 1161354f5dbb9648f90edb3ffb16dc9daad7d966 Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 11 Apr 2025 00:54:01 -0400 Subject: Automatically add a halt to the end of every program --- src/emit.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emit.lisp b/src/emit.lisp index 48ebebe..a6e4bbb 100644 --- a/src/emit.lisp +++ b/src/emit.lisp @@ -31,7 +31,9 @@ concatenated with TYPE." (mapcar (lambda (x) (util:format-as-binary x 32)) lst)) (defun x (&rest lst) - lst) + (append lst + ;; add a halt to the end of the instructions list + (list (r "QUOT" (rr 0) (rr 0) (rr 0))))) (defun r (mnemonic s1 s2 d) (concatenate @@ -58,7 +60,7 @@ concatenated with TYPE." (defun var (s) (let ((pos (util:get-variable s))) - (+ pos parse:line-number))) + (+ pos parse:line-number 1))) (defun emit (p) (eval p)) -- cgit v1.2.3