Truth machine
This commit is contained in:
parent
fda7baea7f
commit
3c51927c9a
1 changed files with 27 additions and 0 deletions
27
flagpole/tests/truthmachine.fp
Normal file
27
flagpole/tests/truthmachine.fp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
proc putchar
|
||||
0xCFFFFFFFFFFFFFFD st8
|
||||
endproc
|
||||
|
||||
proc getchar
|
||||
0xCFFFFFFFFFFFFFFE ld8
|
||||
endproc
|
||||
|
||||
proc puts
|
||||
while dup ld8 0 == not do
|
||||
dup ld8 :putchar
|
||||
1 u+
|
||||
endwhile
|
||||
pop
|
||||
endproc
|
||||
|
||||
proc newline
|
||||
10 :putchar
|
||||
endproc
|
||||
|
||||
proc main
|
||||
:getchar
|
||||
dup :putchar
|
||||
while dup "1" ld8 == do
|
||||
dup :putchar
|
||||
endwhile
|
||||
endproc
|
||||
Loading…
Add table
Add a link
Reference in a new issue