Created
March 5, 2012 13:06
-
-
Save nyuichi/1978242 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 fib (n) | |
(if (< n 2) | |
1 | |
(+ (fib (- n 1)) (fib (- n 2))))) | |
(fib 30) | |
------------------------------------------- | |
[0] const 0x79 ; fixnum(30) | |
[5] call 6 ; fib | |
[10] halt | |
fib: | |
[11] const 0x09 ; fixnum(2) | |
[16] lref -1 ; n | |
[21] lt | |
[22] jnz 11 ; [33] | |
[27] const 0x05 ; fixnum(1) | |
[32] ret | |
[33] const 0x09 ; fixnum(2) | |
[38] lref -1 ; n | |
[43] sub | |
[44] call -33 ; fib | |
[49] const 0x05 ; fixnum(1) | |
[54] lref -1 ; n | |
[59] sub | |
[60] call -49 ; fib | |
[65] add | |
[66] ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment