Prev: DD37 Up: Map Next: DD84
DD6C: Checksum Tape
Used by the routines at Tape_Save and Tape_Load.
Adds every byte in the tape block after writing 00 to *TapeChecksum. L keeps the previous checksum for the load compare.
Output
A The checksum
L The previous *TapeChecksum
Point at the tape block.
Tape_Checksum DD6C CALL Tape_BlockRange Call Tape_BlockRange.
Keep the previous checksum and clear the stored one.
DD6F XOR A Clear the sum.
DD70 LD HL,($6488) Copy *TapeChecksum into L.
DD73 LD ($6488),A Write 00 to *TapeChecksum.
DD76 LD H,A Clear H.
Add each byte into the running total.
Tape_Checksum_Loop DD77 ADD A,(IX+$00) Add *(IX) into A and keep the sum in H.
DD7A LD H,A
DD7B INC IX Move to the next byte.
DD7D DEC DE
DD7E LD A,E Test whether DE is zero.
DD7F OR D
DD80 LD A,H Restore the sum.
DD81 JR NZ,Tape_Checksum_Loop Jump to Tape_Checksum_Loop if DE is not zero.
Return.
DD83 RET Return.
Prev: DD37 Up: Map Next: DD84