2020-04-30 16:10:35 -04:00
|
|
|
: _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
|
2020-05-07 15:40:10 -04:00
|
|
|
8 LSHIFT + ( cylsec )
|
2020-04-30 16:10:35 -04:00
|
|
|
;
|
|
|
|
: FD@! ( wref blk -- )
|
2020-05-01 14:38:31 -04:00
|
|
|
1 @DCSTAT NOT IF _err THEN
|
2020-05-07 15:40:10 -04:00
|
|
|
2 LSHIFT ( 4 * -- wr sec )
|
2020-04-30 16:10:35 -04:00
|
|
|
4 0 DO ( wr sec )
|
|
|
|
DUP I + _cylsec ( wr sec cs )
|
2020-05-07 15:40:10 -04:00
|
|
|
I 8 LSHIFT BLK( + ( wr sec cs addr )
|
2020-04-30 16:10:35 -04:00
|
|
|
1 ROT ROT ( wr sec drv cs addr )
|
|
|
|
4 PICK EXECUTE NOT IF _err THEN
|
|
|
|
LOOP 2DROP ;
|