1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-17 05:08:05 +11:00

Add words FLUSH and COPY

This commit is contained in:
Virgil Dupras 2020-04-29 20:21:18 -04:00
parent 581f04a4bc
commit 0cf26547ff
4 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,8 @@
Disk
BLK> -- a Address of the current block variable.
COPY s d -- Copy contents of s block to d block.
FLUSH -- Write current block to disk if dirty.
LIST n -- Prints the contents of the block n on screen
in the form of 16 lines of 64 columns.
LOAD n -- Interprets Forth code from block n

View File

@ -2,10 +2,10 @@
BLK> @ BLK!* @ EXECUTE
0 BLKDTY !
;
: FLUSH BLKDTY @ IF BLK! THEN ;
: BLK@ ( n -- )
FLUSH
DUP BLK> @ = IF DROP EXIT THEN
BLKDTY @ IF BLK! THEN
DUP BLK> ! BLK@* @ EXECUTE
;

View File

@ -2,3 +2,6 @@
: LOADR 1+ SWAP DO I DUP . CRLF LOAD LOOP ;
: WIPE BLK( 1024 0 FILL BLK!! ;
( src dst -- )
: COPY SWAP BLK@ BLK> ! BLK! ;

Binary file not shown.