summaryrefslogtreecommitdiff
path: root/src/emit.lisp
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-04-16 16:43:38 -0400
committerGitHub <noreply@github.com>2025-04-16 16:43:38 -0400
commit3b8a36443a6d83b54fc698a774ef50705f36dcb9 (patch)
treec129a6d326a10f40e1a53144313d397b71eefba7 /src/emit.lisp
parent890119fceed9c57c86b43ace15ee016eb403c36a (diff)
parent76dca859f9a4c5e5575a3097d3d3a6f96d781258 (diff)
Merge pull request #9 from bdunahu/bdunahu
Let displacement for JAL+JMP be the absolute file position of label
Diffstat (limited to 'src/emit.lisp')
-rw-r--r--src/emit.lisp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/emit.lisp b/src/emit.lisp
index 78a41ed..85214c2 100644
--- a/src/emit.lisp
+++ b/src/emit.lisp
@@ -48,8 +48,8 @@ concatenated with TYPE."
(defun x (&rest lst)
(append lst
- ;; add a halt to the end of the instructions list
- (list (r "QUOT" (rr 0) (rr 0) (rr 0)))))
+ ;; 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
@@ -68,9 +68,9 @@ concatenated with TYPE."
(util:format-as-binary val 5)
(error (format nil "~a is not a valid register id!~%" val))))
-(defun l (l s)
+(defun l (l &optional (pos 0))
(let ((d (util:get-label l)))
- (- d s)))
+ (- d pos)))
(defun var (s)
(let ((pos (util:get-variable s)))