2023-07-01 18:15:57 +00:00
|
|
|
|
|
|
|
\ *** Block No. 0, Hexblock 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\ *** Block No. 1, Hexblock 1
|
|
|
|
|
2023-08-20 19:54:27 +00:00
|
|
|
\ log2file loadscreen phz 20aug23
|
2023-07-01 18:15:57 +00:00
|
|
|
|
|
|
|
1 3 +thru
|
|
|
|
|
2023-08-20 19:54:27 +00:00
|
|
|
\\
|
|
|
|
: .1x ( n -- ) $30 + dup $39 > IF 7 + THEN (emit ;
|
2023-07-01 18:15:57 +00:00
|
|
|
|
2023-08-20 19:54:27 +00:00
|
|
|
: .4x ( n -- )
|
|
|
|
ascii $ (emit 4 0 DO $10 u/mod LOOP drop .1x .1x .1x .1x
|
|
|
|
$20 (emit ;
|
2023-07-01 18:15:57 +00:00
|
|
|
|
2023-08-20 19:54:27 +00:00
|
|
|
: .2x ( n -- )
|
|
|
|
ascii $ (emit 2 0 DO $10 u/mod LOOP drop .1x .1x
|
|
|
|
$20 (emit ;
|
2023-07-01 18:15:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\ *** Block No. 2, Hexblock 2
|
|
|
|
|
2023-08-20 19:54:27 +00:00
|
|
|
\ logfile phz 20aug23
|
2023-07-01 18:15:57 +00:00
|
|
|
|
|
|
|
Dos also Forth definitions
|
|
|
|
|
|
|
|
$18 constant fcb\nam
|
|
|
|
create logfile ," LOGFILE TXT" fcb\nam allot 1 logfile c!
|
|
|
|
create logdma b/rec allot
|
|
|
|
variable logoffset 0 logoffset !
|
|
|
|
|
2023-08-20 19:54:27 +00:00
|
|
|
: logflush logdma dma! logfile $15 bdos $80 dma! ;
|
2023-07-01 18:15:57 +00:00
|
|
|
|
|
|
|
: logc! ( c -- )
|
2023-08-20 19:54:27 +00:00
|
|
|
logoffset @ dup >r logdma + c! r> 1+
|
2023-07-01 18:15:57 +00:00
|
|
|
dup logoffset ! b/rec =
|
|
|
|
IF logflush 0 logoffset ! THEN ;
|
|
|
|
|
|
|
|
|
|
|
|
\ *** Block No. 3, Hexblock 3
|
|
|
|
|
|
|
|
\ log-emit log-type log-cr alsologtofile pphz 01jul23
|
|
|
|
|
|
|
|
: log-emit ( char -- )
|
|
|
|
dup (emit logc! ;
|
|
|
|
|
|
|
|
: log-type ( addr count -- )
|
|
|
|
2dup (type 0 ?DO count logc! LOOP drop ;
|
|
|
|
|
|
|
|
: log-cr ( -- )
|
|
|
|
(cr #cr logc! #lf logc! ;
|
|
|
|
|
|
|
|
Output: alsologtofile
|
|
|
|
log-emit log-cr log-type (del (page (at (at? ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\ *** Block No. 4, Hexblock 4
|
|
|
|
|
2023-08-20 19:54:27 +00:00
|
|
|
\ logopen phz 20aug23
|
2023-07-01 18:15:57 +00:00
|
|
|
|
|
|
|
: logopen ( -- )
|
|
|
|
logfile filenamelen + 1+ fcb\nam erase
|
2023-08-20 19:54:27 +00:00
|
|
|
0 logoffset !
|
2023-07-01 18:15:57 +00:00
|
|
|
logfile killfile
|
|
|
|
logfile createfile
|
|
|
|
alsologtofile ;
|
|
|
|
|
|
|
|
: logclose ( -- )
|
2023-07-01 22:11:52 +00:00
|
|
|
cr display &26 logc! logflush logfile closefile ;
|
2023-07-01 18:15:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|