Created
June 6, 2015 09:18
-
-
Save rygorous/6f5427c5ca0e6a474f49 to your computer and use it in GitHub Desktop.
Loop coding
This file contains hidden or 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
Making the hot path (in this case, no match) fall-through: | |
--- before --- | |
mov up,down | |
mov up,down | |
# check 4 | |
l:mov up,acc | |
sub 4 | |
jez z | |
mov 0,right | |
jmp t | |
z:mov 1,right | |
t:add 4 | |
mov acc,down | |
jmp l | |
--- after --- | |
mov up,down | |
mov up,down | |
jmp l | |
# check 4 | |
f:mov 0,right | |
t:add 4 | |
mov acc,down | |
l:mov up,acc | |
sub 4 | |
jnz f | |
mov 1,right | |
jmp t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment