Last active
August 29, 2015 13:56
-
-
Save antonijn/9117573 to your computer and use it in GitHub Desktop.
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
getch: | |
peek64 0 | |
peek64 8 | |
peek64 16 | |
peek64 24 | |
dup abs(1) | |
deref64 | |
dup abs(2) | |
ult | |
cjmp .0 | |
fail: | |
load -1 | |
ret | |
.0: | |
dup abs(1) | |
dup | |
deref64 | |
inc | |
store64 | |
load 2 | |
umul | |
dup abs(0) | |
add | |
deref64 | |
dup | |
load fc00h | |
and | |
load d800h | |
eq | |
cjmp .1 | |
swap 1, 2 | |
store64 | |
load 0 | |
ret | |
.1: | |
dup abs(1) | |
deref64 | |
dup abs(2) | |
ulte | |
cjmp fail | |
dup abs(1) | |
dup | |
deref64 | |
inc | |
store64 | |
load 2 | |
umul | |
dup abs(0) | |
add | |
deref64 | |
dup | |
load fc00h | |
and | |
load dc00h | |
neq | |
cjmp fail | |
dup abs(3) | |
dup abs(4) | |
load 03ffh | |
and | |
load 10 | |
shl | |
dup abs(5) | |
load 03ffh | |
and | |
or | |
store64 | |
load 0 | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment