2020-10-29 21:03:11 -04:00
|
|
|
: _ ( dstaddr blkno -- )
|
2020-09-17 09:36:16 -04:00
|
|
|
[ SDC_DEVID LITN ] (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 )
|
2020-10-29 21:03:11 -04:00
|
|
|
_idle ( crc a n )
|
|
|
|
DUP ROT C!+ ( crc n a+1 )
|
|
|
|
ROT> _crc16 ( a+1 crc )
|
|
|
|
SWAP ( crc a+1 )
|
2020-04-23 13:55:00 -04:00
|
|
|
LOOP
|
|
|
|
DROP ( crc1 )
|
2020-05-07 15:40:10 -04:00
|
|
|
_idle 8 LSHIFT _idle + ( crc2 )
|
2020-09-17 09:36:16 -04:00
|
|
|
_wait DROP 0 (spie)
|
2020-04-23 13:55:00 -04:00
|
|
|
= NOT IF _err THEN ;
|