31 lines
548 B
Text
31 lines
548 B
Text
%newline { [ LIT2 0a -Console/write ] DEO }
|
|
|
|
|18 @Console/write
|
|
|
|
|100
|
|
|
|
#1400
|
|
&loop
|
|
DUP #00 SWP fibonacci print/dec newline
|
|
INC GTHk ?&loop
|
|
POP2
|
|
|
|
BRK
|
|
|
|
@fibonacci ( n* -- n!* )
|
|
ORAk ?{ JMP2r }
|
|
ORAk #01 NEQ ?{ JMP2r }
|
|
DUP2 #0001 SUB2 fibonacci STH2
|
|
#0002 SUB2 fibonacci
|
|
STH2r ADD2
|
|
JMP2r
|
|
|
|
@print/dec ( short* -- )
|
|
#000a SWP2 [ LITr ff ]
|
|
&get ( -- )
|
|
SWP2k DIV2k MUL2 SUB2 STH
|
|
POP OVR2 DIV2 ORAk ?&get
|
|
POP2 POP2
|
|
&put ( -- )
|
|
STHr INCk ?{ POP JMP2r }
|
|
[ LIT "0 ] ADD .Console/write DEO !&put
|