Skip to content

Commit aeb29a4

Browse files
committed
drop path storage
1 parent ece5ced commit aeb29a4

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

forth/block.fs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,24 @@
33
create bbi 0 , 0 c, \ buffer block id's
44
create dirty 0 , 0 c,
55
create curr-buf 0 c,
6-
create path 'b' c, 3 allot
76

87
: >addr ( buf -- addr )
98
$400 * $c000 + ;
109

1110
: >path ( blk -- )
12-
#10 /mod #10 /mod
13-
4 1 do '0' + path i + c! loop ;
11+
'b' here c! #10 /mod #10 /mod
12+
4 1 do '0' + here i + c! loop ;
1413

1514
: save-buf ( buf -- )
1615
dup dirty + c@ 0= if drop exit then
1716
0 over dirty + c!
1817
dup bbi + c@ >path >addr dup $400 +
19-
path 4 saveb ;
18+
here 4 saveb ;
2019

2120
: >buf ( blk -- buf ) 3 mod ;
2221

2322
: load-blk ( blk -- )
24-
dup >path >buf >addr >r path 4
23+
dup >path >buf >addr >r here 4
2524
r@ loadb 0= if r@ $400 erase then
2625
r> drop ;
2726

0 commit comments

Comments
 (0)