Implemented drop directive and fibonacci program
This commit is contained in:
parent
bb662f6079
commit
1140b5b140
2 changed files with 26 additions and 0 deletions
21
flagpole/tests/fib.fp
Normal file
21
flagpole/tests/fib.fp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
$inc fvmstd.fp
|
||||
|
||||
proc fib
|
||||
if dup 0 == then
|
||||
drop 0 return
|
||||
endif
|
||||
if dup 1 == then
|
||||
drop 1 return
|
||||
endif
|
||||
|
||||
dup
|
||||
1 u- :fib
|
||||
swap
|
||||
2 u- :fib
|
||||
u+
|
||||
endproc
|
||||
|
||||
proc main
|
||||
"Idx: " :puts :getuint
|
||||
:fib :putuint
|
||||
endproc
|
||||
Loading…
Add table
Add a link
Reference in a new issue