diff options
author | mRnea <[email protected]> | 2024-08-01 00:08:18 +0300 |
---|---|---|
committer | mRnea <[email protected]> | 2024-08-01 00:08:18 +0300 |
commit | 8713ffbd95483fc8b6778fb2d4d67659b6217c42 (patch) | |
tree | 5851500b81257b46d7e1e22abd17f0e1e4437da2 | |
parent | 56f71f43b24456d1f9f17adef389b2aebf2a9026 (diff) |
fixed | and & ops, added a new dep (cl-fad util library)
-rw-r--r-- | assembly.lisp | 21 | ||||
-rw-r--r-- | cl-forth.asd | 5 |
2 files changed, 13 insertions, 13 deletions
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" diff --git a/cl-forth.asd b/cl-forth.asd index cb77107..455a735 100644 --- a/cl-forth.asd +++ b/cl-forth.asd @@ -3,13 +3,14 @@ :version "0.1" :author "Emre Akan" :licence "MIT" - :depends-on ("iterate") + :depends-on ("iterate" "cl-fad") :serial t :components ((:file "package") (:file "util") (:file "assembly") (:file "cl-forth") - (:file "main")) + (:file "main") + (:file "test/tests")) :build-operation "program-op" :build-pathname "test/cl-forth" :entry-point "cl-forth:main") |