; ******************************************; Calculates the checksum and returns if it is correct; a1 - pointer to end of rom address; ******************************************CalculateChecksum:movea.l#$200,a0; move start of rom address into a0move.l(a1),d0; copy the value from the address pointed by a1 into d0moveq#0,d1; move 0 into d1ChecksunLoop:add.w(a0)+,d1; add value in a1 into d0cmp.la0,d0; did we finish checksumming the entire rom?bcc.sChecksumLoop; if not continue checksumming the rommovea.l#$18E,a1; move checksum into a1cmp.w(a1),d1; is the checksum correct?bne.s@WrongChecksum; if checksum is wrong branch to wrong checksum code moveq#0,d0; checksum is correct so set d0 to 0bra@CorrectChecksum; and jump over wrong checksum code@WrongChecksummoveq#1,d0; checksum is wrong so set d0 to 1@CorrectChecksumrts
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.