diff --git a/arch/8086/pcat/blk.fs b/arch/8086/pcat/blk.fs index ecae3a1..bb4f68a 100644 --- a/arch/8086/pcat/blk.fs +++ b/arch/8086/pcat/blk.fs @@ -85,4 +85,4 @@ RS_ADDR 0xa0 - CONSTANT SYSVARS 610 LOAD ( AT-XY drivers ) 390 LOAD ( xcomp core high ) (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -," BLK$ FD$ ' FD@ BLK@* ! ' FD! BLK!* ! " EOT, +," BLK$ FD$ ' FD@ ' BLK@* **! ' FD! ' BLK!* **! " EOT, diff --git a/arch/z80/sms/xcomptextmode.fs b/arch/z80/sms/xcomptextmode.fs index 9dc74b7..3d88da0 100644 --- a/arch/z80/sms/xcomptextmode.fs +++ b/arch/z80/sms/xcomptextmode.fs @@ -39,7 +39,7 @@ CREATE ~FNT CPFNT5x7 (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -," TMS$ GRID$ PS2$ BLK$ ' SDC@ BLK@* ! (im1) " EOT, +," TMS$ GRID$ PS2$ BLK$ ' SDC@ ' BLK@* **! (im1) " EOT, ORG @ 0x100 - DUP |M 2 PC! 2 PC! DUP 1 ( 16K ) segasig 0x4000 + |M 2 PC! 2 PC! diff --git a/arch/z80/trs80/blk.fs b/arch/z80/trs80/blk.fs index cef0143..764c1c3 100644 --- a/arch/z80/trs80/blk.fs +++ b/arch/z80/trs80/blk.fs @@ -98,7 +98,7 @@ EXX, ( unprotect BC ) ;CODE ( ----- 610 ) : FD@ ['] @RDSEC SWAP FD@! ; : FD! ['] @WRSEC SWAP FD@! ; -: FD$ ['] FD@ BLK@* ! ['] FD! BLK!* ! ; +: FD$ ['] FD@ ['] BLK@* **! ['] FD! ['] BLK!* **! ; : CL$ 0x02 0xe8 PC! ( UART RST ) 0xee 0xe9 PC! ( 9600 bauds ) 0b01101100 0xea PC! ( word8 no parity RTS ) ; diff --git a/arch/z80/z80mbc2/xcomp.fs b/arch/z80/z80mbc2/xcomp.fs index 645e861..19ce6e4 100644 --- a/arch/z80/z80mbc2/xcomp.fs +++ b/arch/z80/z80mbc2/xcomp.fs @@ -38,6 +38,6 @@ CODE (key?) ( TODO: make non-blocking ) (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -," BLK$ FD$ ' FD@ BLK@* ! ' FD! BLK!* ! " EOT, +," BLK$ FD$ ' FD@ ' BLK@* **! ' FD! ' BLK!* **! " EOT, ORG @ |M 2 PC! 2 PC! H@ |M 2 PC! 2 PC! diff --git a/blk.fs b/blk.fs index 8379e72..b0294e2 100644 --- a/blk.fs +++ b/blk.fs @@ -833,7 +833,7 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 , : $H EDPOS @ 0x3c0 AND pos! ; : $L EDPOS @ 0x3f OR pos! ; : $g ACC @ 1 MAX 1- 64 * pos! ; -: $@ BLK> @ BLK@* @ EXECUTE 0 BLKDTY ! contents ; +: $@ BLK> @ BLK@* 0 BLKDTY ! contents ; ( ----- 130 ) : $w EDPOS @ BLK( + acc@ 0 DO BEGIN C@+ WS? UNTIL BEGIN C@+ WS? NOT UNTIL LOOP @@ -1911,9 +1911,9 @@ SYSVARS 0x55 + :** KEY? : [THEN] ; ( ----- 372 ) ( n -- Fetches block n and write it to BLK( ) -: BLK@* 0x34 RAM+ ; +SYSVARS 0x34 + :** BLK@* ( n -- Write back BLK( to storage at block n ) -: BLK!* 0x36 RAM+ ; +SYSVARS 0x36 + :** BLK!* ( Current blk pointer in ( ) : BLK> 0x38 RAM+ ; ( Whether buffer is dirty ) @@ -1931,13 +1931,11 @@ SYSVARS 0x55 + :** KEY? -1 BLK> ! ; ( ----- 374 ) -: BLK! ( -- ) - BLK> @ BLK!* @ EXECUTE - 0 BLKDTY ! ; +: BLK! ( -- ) BLK> @ BLK!* 0 BLKDTY ! ; : FLUSH BLKDTY @ IF BLK! THEN -1 BLK> ! ; : BLK@ ( n -- ) DUP BLK> @ = IF DROP EXIT THEN - FLUSH DUP BLK> ! BLK@* @ EXECUTE ; + FLUSH DUP BLK> ! BLK@* ; : BLK!! 1 BLKDTY ! ; : WIPE BLK( 1024 0 FILL BLK!! ; : WIPED? ( -- f ) diff --git a/cvm/forth.fs b/cvm/forth.fs index 06cd97b..7093c9d 100644 --- a/cvm/forth.fs +++ b/cvm/forth.fs @@ -9,7 +9,7 @@ SYSVARS 0xa0 + CONSTANT GRID_MEM (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -," BLK$ ' EFS@ BLK@* ! ' EFS! BLK!* ! GRID$ " EOT, +," BLK$ ' EFS@ ' BLK@* **! ' EFS! ' BLK!* **! GRID$ " EOT, ORG @ |M 2 PC! 2 PC! H@ |M 2 PC! 2 PC! diff --git a/cvm/stage.bin b/cvm/stage.bin index 4badec7..283b2cb 100644 Binary files a/cvm/stage.bin and b/cvm/stage.bin differ diff --git a/cvm/stage.fs b/cvm/stage.fs index 294c00a..809c5b7 100644 --- a/cvm/stage.fs +++ b/cvm/stage.fs @@ -4,8 +4,8 @@ ( Update LATEST ) PC ORG @ 8 + ! ," BLK$ " -," ' EFS@ BLK@* ! " -," ' EFS! BLK!* ! " +," ' EFS@ ' BLK@* **! " +," ' EFS! ' BLK!* **! " EOT, ORG @ |M 2 PC! 2 PC! H@ |M 2 PC! 2 PC! diff --git a/doc/hw/sdcard.txt b/doc/hw/sdcard.txt index 1ef4316..dcb6fa5 100644 --- a/doc/hw/sdcard.txt +++ b/doc/hw/sdcard.txt @@ -15,8 +15,9 @@ The subsystem is loaded with "423 436 LOADR". Initialization of the SDC system is done in multiple steps. First, the BLK system needs to be initialized with "BLK$". Then -you can plug SDC@ and SDC! into BLK with "' SDC@ BLK@* !" and -"' SDC! BLK! !". That only needs to be done once per boot. +you can plug SDC@ and SDC! into BLK with "' SDC@ ' BLK@* **!" +and "' SDC! ' BLK! **!". That only needs to be done once per +boot. Then, the SD card that was inserted needs to be initialized. You can do it with "SDC$". If you have no error, it means that the diff --git a/doc/impl.txt b/doc/impl.txt index ea5a632..76a3929 100644 --- a/doc/impl.txt +++ b/doc/impl.txt @@ -172,6 +172,7 @@ SYSVARS FUTURE USES +3c BLK(* +2e BOOT C< PTR +57 FUTURE USES +30 IN> +60 INPUT BUFFER +32 FUTURE USES +a0 DRIVERS ++34 BLK@* +36 BLK!* +38 BLK> +3a BLKDTY diff --git a/emul/8086/xcomp.fs b/emul/8086/xcomp.fs index e1b6839..943b852 100644 --- a/emul/8086/xcomp.fs +++ b/emul/8086/xcomp.fs @@ -19,8 +19,8 @@ CODE PC! AX POPx, ( discard ) AX POPx, 6 INT, ;CODE 390 LOAD ( xcomp core high ) (entry) _ ( Update LATEST ) PC ORG @ 8 + ! ," BLK$ " -," ' EFS@ BLK@* ! " -," ' EFS! BLK!* ! " +," ' EFS@ ' BLK@* **! " +," ' EFS! ' BLK!* **! " EOT, ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC! diff --git a/emul/z80/xcomp.fs b/emul/z80/xcomp.fs index 224de01..c0c30ef 100644 --- a/emul/z80/xcomp.fs +++ b/emul/z80/xcomp.fs @@ -28,8 +28,8 @@ RS_ADDR 0xa0 - CONSTANT SYSVARS ( Update LATEST ) PC ORG @ 8 + ! ," BLK$ " -," ' EFS@ BLK@* ! " -," ' EFS! BLK!* ! " +," ' EFS@ ' BLK@* **! " +," ' EFS! ' BLK!* **! " EOT, ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!