We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ece5ced commit aeb29a4Copy full SHA for aeb29a4
1 file changed
forth/block.fs
@@ -3,25 +3,24 @@
3
create bbi 0 , 0 c, \ buffer block id's
4
create dirty 0 , 0 c,
5
create curr-buf 0 c,
6
-create path 'b' c, 3 allot
7
8
: >addr ( buf -- addr )
9
$400 * $c000 + ;
10
11
: >path ( blk -- )
12
-#10 /mod #10 /mod
13
-4 1 do '0' + path i + c! loop ;
+'b' here c! #10 /mod #10 /mod
+4 1 do '0' + here i + c! loop ;
14
15
: save-buf ( buf -- )
16
dup dirty + c@ 0= if drop exit then
17
0 over dirty + c!
18
dup bbi + c@ >path >addr dup $400 +
19
-path 4 saveb ;
+here 4 saveb ;
20
21
: >buf ( blk -- buf ) 3 mod ;
22
23
: load-blk ( blk -- )
24
-dup >path >buf >addr >r path 4
+dup >path >buf >addr >r here 4
25
r@ loadb 0= if r@ $400 erase then
26
r> drop ;
27
0 commit comments