Last active
December 30, 2015 20:49
-
-
Save rubyist/7882973 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
@R2 // A = 2 | |
M=0 // Memory[2] = 0 | |
(LOOP) | |
@R1 // A = 1 | |
M=M-1 // Memory[1] = Memory[1] - 1 | |
D=M // D = Memory[1] | |
@END | |
D;JLT // Jump to @END if D < 0 | |
@R0 // A = 0 | |
D=M // D = Memory[0] | |
@R2 // A = 2 | |
M=D+M // Memory[2] = D + Memory[2] | |
@LOOP // Loop | |
0;JMP | |
(END) | |
@END | |
0;JMP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
heh this is what it would look like in redscript: