Created
June 27, 2022 13:23
-
-
Save Ismael-VC/f20d4ca61db5510f89435bd9cdec1a65 to your computer and use it in GitHub Desktop.
8-bit fibonacci in Uxntal.
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
%CALL { JSR2 } | |
%RTN { JMP2r } | |
%NOT { #01 EOR } | |
%DEBUG { #01 #0e DEO } | |
|0100 | |
( DEBUG ) | |
#0d ;fib CALL | |
#e9 EQU | |
BRK | |
@fib ( n -- n' ) | |
DUPk | |
#01 EQU | |
SWP | |
#00 EQU | |
ORA NOT | |
,&recurse JCN | |
,&end JMP | |
&recurse | |
DUP | |
#01 SUB ;fib CALL | |
SWP | |
#02 SUB ;fib CALL | |
ADD | |
&end | |
RTN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment