Prev: 56631 Up: Map Next: 56708
56684: Checksum Tape
Used by the routines at Tape_Save and Tape_Load.
Adds every byte in the tape block after writing 0 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 56684 CALL Tape_BlockRange Call Tape_BlockRange.
Keep the previous checksum and clear the stored one.
56687 XOR A Clear the sum.
56688 LD HL,(25736) Copy *TapeChecksum into L.
56691 LD (25736),A Write 0 to *TapeChecksum.
56694 LD H,A Clear H.
Add each byte into the running total.
Tape_Checksum_Loop 56695 ADD A,(IX+0) Add *(IX) into A and keep the sum in H.
56698 LD H,A
56699 INC IX Move to the next byte.
56701 DEC DE
56702 LD A,E Test whether DE is zero.
56703 OR D
56704 LD A,H Restore the sum.
56705 JR NZ,Tape_Checksum_Loop Jump to Tape_Checksum_Loop if DE is not zero.
Return.
56707 RET Return.
Prev: 56631 Up: Map Next: 56708