From 8713ffbd95483fc8b6778fb2d4d67659b6217c42 Mon Sep 17 00:00:00 2001 From: mRnea Date: Thu, 1 Aug 2024 00:08:18 +0300 Subject: fixed | and & ops, added a new dep (cl-fad util library) --- assembly.lisp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'assembly.lisp') diff --git a/assembly.lisp b/assembly.lisp index 13623c7..e872ee8 100644 --- a/assembly.lisp +++ b/assembly.lisp @@ -112,18 +112,17 @@ (with-gensyms (out-stream) (destructuring-bind (op-name . args) (mklist op-name+args) `(progn - ,@(append - (unless (null lex) - `((push ',op-name *identifiers*))) - `((setf (gethash ,(string op-name) *operations*) - (lambda (,out-stream ,@args) - ,@(mapcar #'(lambda (group) (expand-group group out-stream - :indent indent)) - (group-by-syntax body)))))))))) + ,@(unless (null lex) + `((push ',op-name *identifiers*))) + (setf (gethash ,(string op-name) *operations*) + (lambda (,out-stream ,@args) + ,@(mapcar #'(lambda (group) (expand-group group out-stream + :indent indent)) + (group-by-syntax body)))))))) ;;; TODO: Turn stack operation comments to DEFOP option, ;;; which then can be used by the user as a documentation -;;; TODO: Better yet, generate the asm code directly from +;;; DONE: Better yet, generate the asm code directly from ;;; the stack op documentation (this seems easily doable) ;;; Hopefully these two are done, need testing... @@ -193,10 +192,10 @@ (rbx rcx -- (:shr rbx cl))) (defop "|" () - (rbx rcx -- (:or rbx cl))) + (rbx rax -- (:or rbx rax))) (defop & () - (rbx rcx -- (:and rbx cl))) + (rbx rax -- (:and rbx rax))) (defop dump () "pop rdi" -- cgit v1.2.3