diff options
author | mRnea <[email protected]> | 2024-07-30 22:38:29 +0300 |
---|---|---|
committer | mRnea <[email protected]> | 2024-07-30 22:38:29 +0300 |
commit | 7f6bb99e08f135fcf067ef71da9f11c872ab7993 (patch) | |
tree | f71751b3561070e175e008bd7462e1238b832783 /assembly.lisp | |
parent | 7562c4b30ba918928308da23487bffc92d4de37b (diff) |
added bit shifts (<< >>), bitand (&), bitor (|), rot, over, swap ops
Diffstat (limited to 'assembly.lisp')
-rw-r--r-- | assembly.lisp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/assembly.lisp b/assembly.lisp index 1ddd326..e4582de 100644 --- a/assembly.lisp +++ b/assembly.lisp @@ -147,6 +147,58 @@ (:write ("pop ~a" (aref call-regs i))) (finally (:write "syscall")))) +;;; (rbx rax -- rbx rax rbx) +(defop üst () + "pop rax" + "pop rbx" + "push rbx" + "push rax" + "push rbx") + +;;; (rcx rbx rax -- rbx rax rcx) +(defop rot () + "pop rax" + "pop rbx" + "pop rcx" + "push rbx" + "push rax" + "push rcx") + +;;; (rbx rax -- rax rbx) +(defop değiş () + "pop rax" + "pop rbx" + "push rax" + "push rbx") + +;;; (rbx rcx -- (:shl rbx cl)) +(defop << () + "pop rcx" + "pop rbx" + "shl rbx, cl" + "push rbx") + +;;; (rbx rcx -- (:shr rbx cl)) +(defop >> () + "pop rcx" + "pop rbx" + "shr rbx, cl" + "push rbx") + +;;; (rbx rcx -- (:or rbx cl)) +(defop "|" () + "pop rax" + "pop rbx" + "or rbx, rax" + "push rbx") + +;;; (rbx rcx -- (:and rbx cl)) +(defop & () + "pop rax" + "pop rbx" + "and rbx, rax" + "push rbx") + (defun gen-header (op str) (format str " ;; -- ~s --~%" op)) |