Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
537B

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