Skip to content

Instantly share code, notes, and snippets.

@Ismael-VC
Created June 27, 2022 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ismael-VC/f20d4ca61db5510f89435bd9cdec1a65 to your computer and use it in GitHub Desktop.
Save Ismael-VC/f20d4ca61db5510f89435bd9cdec1a65 to your computer and use it in GitHub Desktop.
8-bit fibonacci in Uxntal.
%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