mirror of
https://github.com/forth-ev/VolksForth.git
synced 2024-11-22 20:34:07 +00:00
64ed332b12
checked at the end of the Makefile recipe. Also introduces a prebuilt metacompiler metafile.com with integrated fth file include
1 line
6.0 KiB
Plaintext
1 line
6.0 KiB
Plaintext
\ logging to a text file phz 03jan22 \ load screen phz 25feb22 Code m+! ( 16b addr -- ) D W mov W inc W inc A pop A W ) add CS ?[ W dec W dec W ) inc ]? D pop Next end-code : (blk blk @ 0= IF ascii ) parse 2drop THEN ; (blk 1 2 +thru ( ) \ log-type log-emit log-cr phz 25feb22 context @ dos also context ! \ vocabulary log dos also log definitions file logfile variable logfcb variable logpos 0 , : log-type ( addr count -- ) dup logpos m+! 2dup (type ds@ -rot logfcb @ lfputs ; : log-emit ( char -- ) 1 logpos m+! dup (emit logfcb @ fputc ; : log-cr ( -- ) 2 logpos m+! (cr #cr logfcb @ fputc #lf logfcb @ fputc ; \ alsologtofile logopen logclose logreopen phz 25feb22 Output: alsologtofile log-emit log-cr log-type (del (page (at (at? ; : logopen ( -- ) isfile push logpos dup 2+ off off logfile make isfile@ dup freset logfcb ! alsologtofile ; : logclose ( -- ) display logfcb @ fclose ; : logreopen ( -- ) logfcb @ freset logpos 2@ logfcb @ fseek alsologtofile ; \ phz 25feb22 |