From 79ef63fdec3f834b8c1a944cc571232af175bb2a Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Sun, 3 Sep 2023 12:56:45 +0200 Subject: [PATCH] Remove dependency of log2file.fb on xinout.fb, namly (type (page (at and switch tests to use kernel.com instead of volks4th.com --- 8080/CPM/Makefile | 15 +++++++++------ 8080/CPM/tests/log2file.fb | 2 +- 8080/CPM/tests/log2file.fth | 6 +++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/8080/CPM/Makefile b/8080/CPM/Makefile index 97b5a2a..2d4fe57 100644 --- a/8080/CPM/Makefile +++ b/8080/CPM/Makefile @@ -38,10 +38,11 @@ run-volks4th: \ "volks4th" logtest.log: \ - $(patsubst %, $(cpmfilesdir)/%, volks4th.com log2file.fb) \ + $(patsubst %, $(cpmfilesdir)/%, kernel.com fileint.fb log2file.fb) \ | emu ./emulator/run-in-runcpm.sh \ - "volks4th" \ + "kernel fileint.fb" \ + "1 load onlyforth" \ "include log2file.fb" \ "logopen" \ ".( hello world) cr" \ @@ -55,11 +56,12 @@ logtest.log: \ dos2unix -n $(runcpmdir)/logfile.txt $@ inctest.log: \ - $(patsubst %, $(cpmfilesdir)/%, volks4th.com \ + $(patsubst %, $(cpmfilesdir)/%, kernel.com fileint.fb \ include.fb log2file.fb inctest.fth) \ | emu ./emulator/run-in-runcpm.sh \ - "volks4th" \ + "kernel fileint.fb" \ + "1 load onlyforth" \ "include include.fb" \ "include log2file.fb" \ "logopen" \ @@ -85,12 +87,13 @@ target.log: \ dos2unix -n $(runcpmdir)/logfile.txt $@ test-min.log: \ - $(patsubst %, $(cpmfilesdir)/%, volks4th.com \ + $(patsubst %, $(cpmfilesdir)/%, kernel.com fileint.fb \ include.fb log2file.fb \ ans-shim.fth prelim.fth tester.fth core.fr test-min.fth) \ | emu ./emulator/run-in-runcpm.sh \ - "volks4th" \ + "kernel fileint.fb" \ + "1 load onlyforth" \ "include include.fb" \ "include test-min.fth" \ "bye" \ diff --git a/8080/CPM/tests/log2file.fb b/8080/CPM/tests/log2file.fb index cbabf45..516e927 100644 --- a/8080/CPM/tests/log2file.fb +++ b/8080/CPM/tests/log2file.fb @@ -1 +1 @@ - \ log2file loadscreen phz 20aug23 1 3 +thru \\ : .1x ( n -- ) $30 + dup $39 > IF 7 + THEN (emit ; : .4x ( n -- ) ascii $ (emit 4 0 DO $10 u/mod LOOP drop .1x .1x .1x .1x $20 (emit ; : .2x ( n -- ) ascii $ (emit 2 0 DO $10 u/mod LOOP drop .1x .1x $20 (emit ; \ logfile phz 20aug23 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 ! : logflush logdma dma! logfile $15 bdos $80 dma! ; : logc! ( c -- ) logoffset @ dup >r logdma + c! r> 1+ dup logoffset ! b/rec = IF logflush 0 logoffset ! THEN ; \ 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? ; \ logopen phz 20aug23 : logopen ( -- ) logfile filenamelen + 1+ fcb\nam erase 0 logoffset ! logfile killfile logfile createfile alsologtofile ; : logclose ( -- ) cr display &26 logc! logflush logfile closefile ; \ No newline at end of file + \ log2file loadscreen phz 20aug23 1 3 +thru \\ : .1x ( n -- ) $30 + dup $39 > IF 7 + THEN (emit ; : .4x ( n -- ) ascii $ (emit 4 0 DO $10 u/mod LOOP drop .1x .1x .1x .1x $20 (emit ; : .2x ( n -- ) ascii $ (emit 2 0 DO $10 u/mod LOOP drop .1x .1x $20 (emit ; \ logfile phz 20aug23 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 ! : logflush logdma dma! logfile $15 bdos $80 dma! ; : logc! ( c -- ) logoffset @ dup >r logdma + c! r> 1+ dup logoffset ! b/rec = IF logflush 0 logoffset ! THEN ; \ log-emit log-type log-cr alsologtofile pphz 03sep23 : log-emit ( char -- ) dup (emit logc! ; : log-type ( addr count -- ) 0 ?DO count log-emit LOOP drop ; : log-cr ( -- ) (cr #cr logc! #lf logc! ; Output: alsologtofile log-emit log-cr log-type (del noop 2drop (at? ; \ logopen phz 20aug23 : logopen ( -- ) logfile filenamelen + 1+ fcb\nam erase 0 logoffset ! logfile killfile logfile createfile alsologtofile ; : logclose ( -- ) cr display &26 logc! logflush logfile closefile ; \ No newline at end of file diff --git a/8080/CPM/tests/log2file.fth b/8080/CPM/tests/log2file.fth index 9cc2295..80cfe45 100644 --- a/8080/CPM/tests/log2file.fth +++ b/8080/CPM/tests/log2file.fth @@ -58,19 +58,19 @@ \ *** Block No. 3, Hexblock 3 -\ log-emit log-type log-cr alsologtofile pphz 01jul23 +\ log-emit log-type log-cr alsologtofile pphz 03sep23 : log-emit ( char -- ) dup (emit logc! ; : log-type ( addr count -- ) - 2dup (type 0 ?DO count logc! LOOP drop ; + 0 ?DO count log-emit LOOP drop ; : log-cr ( -- ) (cr #cr logc! #lf logc! ; Output: alsologtofile - log-emit log-cr log-type (del (page (at (at? ; + log-emit log-cr log-type (del noop 2drop (at? ;