VolksForth/8086/msdos/src/include.fb

1 line
8.0 KiB
Plaintext
Raw Normal View History

\ include for stream sources phz 06jan22 \ load screen phz 06feb22 1 6 +thru \ fib /fib #fib eolf? phz 06feb22 context @ dos also context ! $50 constant /tib variable tibeof tibeof off : eolf? ( c -- f ) \ f=-1: not yet eol; store c and continue \ f=0: eol but not yet eof; return line and flag continue \ f=1: eof: return line and flag eof tibeof off dup #lf = IF drop 0 exit THEN -1 = IF tibeof on 1 ELSE -1 THEN ; \ incfile incpos inc-fgetc phz 06feb22 variable incfile variable incpos 2 allot : inc-fgetc ( -- c ) incfile @ f.handle @ 0= IF incpos 2@ incfile @ fseek THEN incfile @ fgetc incpos 2@ 1. d+ incpos 2! ;