Last active
March 5, 2025 07:39
-
-
Save sogaiu/0852651705b5b33933d48e8e33956043 to your computer and use it in GitHub Desktop.
DS can be negative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn f | |
[] | |
(var i 32768) | |
(while (pos? i) | |
(when (= i 32768) | |
(print "boo!")) | |
(-- i))) | |
(comment | |
(disasm f :bytecode) | |
# => | |
'@[(ldc 1 0) | |
(push 1) | |
(ldc 3 1) | |
(call 2 3) | |
(jmpno 2 10) | |
(ldc 4 0) | |
(eq 3 1 4) | |
(jmpno 3 5) | |
(ldc 4 2) | |
(push 4) | |
(ldc 5 3) | |
(call 4 5) | |
(subim 1 1 1) | |
(jmp -12) | |
(retn)] | |
(disasm f :constants) | |
# => | |
@[32768 pos? "boo!" print] | |
) | |
(defn main | |
[& _] | |
(getline "Press Enter to start.") | |
(f)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment