2020-04-23 13:55:00 -04:00
|
|
|
: _sdc@ ( dstaddr blkno -- )
|
2020-06-29 18:48:00 -04:00
|
|
|
(spie) 0x51 ( CMD17 ) 0 ROT ( a cmd 0 blkno ) _cmd
|
2020-04-23 13:55:00 -04:00
|
|
|
IF _err THEN
|
|
|
|
_wait 0xfe = NOT IF _err THEN
|
|
|
|
0 SWAP ( crc a )
|
|
|
|
512 0 DO ( crc a )
|
|
|
|
DUP _idle ( crc a a n )
|
|
|
|
DUP ROT C! ( crc a n )
|
|
|
|
ROT SWAP _crc16 ( a crc )
|
|
|
|
SWAP 1+ ( crc a+1 )
|
|
|
|
LOOP
|
|
|
|
DROP ( crc1 )
|
2020-05-07 15:40:10 -04:00
|
|
|
_idle 8 LSHIFT _idle + ( crc2 )
|
2020-06-29 18:48:00 -04:00
|
|
|
_wait DROP (spid)
|
2020-04-23 13:55:00 -04:00
|
|
|
= NOT IF _err THEN ;
|