(fib.tal) Housekeeping

This commit is contained in:
Devine Lu Linvega 2023-07-21 10:42:04 -07:00
parent 98a0c7d609
commit 050690181a
1 changed files with 7 additions and 7 deletions

View File

@ -20,18 +20,18 @@
@fib ( num* -- numfib* ) @fib ( num* -- numfib* )
#0001 GTH2k ?&>ok #0001 GTH2k ?&>ok
POP2 JMP2r &>ok POP2 JMP2r &>ok
( a ) SUB2k fib STH2 SUB2k fib STH2
( b ) INC2 SUB2 fib STH2r INC2 SUB2 fib STH2r
( res ) ADD2 JMP2r ADD2 JMP2r
( (
@|tail-recursive ) @|tail-recursive )
@fibr ( a* b* num* -- a* b* numfib* ) @fibr ( a* b* num* -- a* b* numfib* )
DUP2 #0001 NEQ2 ?&>no-1 #0001 NEQ2k ?&>no-1
POP2 DUP2 JMP2r &>no-1 POP2 POP2 DUP2 JMP2r &>no-1
( a ) #0001 SUB2 STH2 SUB2 STH2
( b ) SWP2 ADD2k NIP2 STH2r !fibr SWP2 OVR2 ADD2 STH2r !fibr
( (
@|stdlib ) @|stdlib )