1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-14 14:48:08 +11:00
collapseos/blk/591
Virgil Dupras f6ded7712e VE: add 't'
This is the first commit I do entirely in VE. It's a habit I'm planning
on taking as it helps a lot to find usability issues.
2020-06-11 18:12:01 -04:00

17 lines
538 B
Plaintext

( With dst being assumed to be an AT28 EEPROM, perform !
operation while doing the right thing. Checks data integrity
and ABORT on mismatch. )
: AT28! ( n a -- )
2DUP C!
( as long as writing operation is running, IO/6 will toggle
at each read attempt. We know that write is finished when
we read the same value twice. )
BEGIN ( n1 a )
DUP C@ ( n1 a n2 )
OVER C@ ( n1 a n2 n3 )
= UNTIL
( We're finished writing. do we have a mismatch? )
C@ = NOT IF ABORT" mismatch" THEN
;