mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 17:48:05 +11:00
17 lines
496 B
Plaintext
17 lines
496 B
Plaintext
: _err ABORT" FDerr" ;
|
|
: _cylsec ( sec -- cs, return sector/cylinder for given secid )
|
|
( 4 256b sectors per block, 10 sec per cyl, 40 cyl max )
|
|
10 /MOD ( sec cyl )
|
|
DUP 39 > IF _err THEN
|
|
256 * + ( cylsec )
|
|
;
|
|
: FD@! ( wref blk -- )
|
|
1 @DCSTAT NOT IF _err THEN
|
|
4 * ( wr sec )
|
|
4 0 DO ( wr sec )
|
|
DUP I + _cylsec ( wr sec cs )
|
|
I 256 * BLK( + ( wr sec cs addr )
|
|
1 ROT ROT ( wr sec drv cs addr )
|
|
4 PICK EXECUTE NOT IF _err THEN
|
|
LOOP 2DROP ;
|