2022-03-25 13:29:45 -04:00
|
|
|
( Fibonacci:
|
|
|
|
A series of numbers where the next number
|
|
|
|
is made of the two numbers before it )
|
2022-02-23 18:23:38 -05:00
|
|
|
|
2022-03-25 13:29:45 -04:00
|
|
|
|0100 ( -> ) @reset
|
2022-02-23 18:23:38 -05:00
|
|
|
|
2022-03-25 13:29:45 -04:00
|
|
|
#0000 INC2k ADD2k
|
|
|
|
&loop
|
2023-03-06 00:09:38 -05:00
|
|
|
DUP2 print #0a18 DEO
|
|
|
|
ADD2k LTH2k ?&loop
|
2022-11-10 12:08:21 -05:00
|
|
|
( halt )
|
|
|
|
#010f DEO
|
2022-02-23 18:23:38 -05:00
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2023-03-06 00:09:38 -05:00
|
|
|
@print ( short* -- )
|
2022-02-23 18:23:38 -05:00
|
|
|
|
2023-03-06 00:09:38 -05:00
|
|
|
SWP print/byte
|
|
|
|
&byte ( byte -- ) DUP #04 SFT print/char
|
2022-03-25 13:29:45 -04:00
|
|
|
&char ( char -- ) #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO
|
2022-02-23 18:23:38 -05:00
|
|
|
|
|
|
|
JMP2r
|