Last active
May 16, 2018 23:49
-
-
Save evanrinehart/634d867ba2dc4c776365d7eb1e2d1a2b 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
def sum(ptr, n, a) | |
n ? sum(ptr, n-1, a + ptr[n-1]) : a | |
ifz n goto L | |
r1 = r1 - 1 | |
r4 = r1 - 1 # without CSE | |
r3 = ptr[r4] | |
r2 = r2 + r3 | |
goto 0 # loopification | |
L: | |
r0 = r2 | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment