Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; loc_328:
- ChecksumTest:
- ; optimized checksum routine by MarkeyJester
- if skipChecksumCheck=0 ; checksum code
- movea.l #EndOfHeader,a0 ; prepare start address
- move.l (ROMEndLoc).w,d7 ; load size
- sub.l a0,d7 ; minus start address
- move.b d7,d5 ; copy end nybble
- andi.w #$F,d5 ; get only the remaining nybble
- lsr.l #4,d7 ; divide the size by 20
- move.w d7,d6 ; load lower word size
- swap d7 ; get upper word size
- moveq #0,d0 ; clear d0
- ; loc_338:
- .loop_main:
- add.w (a0)+,d0 ; modular checksum (8 words)
- add.w (a0)+,d0 ; ''
- add.w (a0)+,d0 ; ''
- add.w (a0)+,d0 ; ''
- add.w (a0)+,d0 ; ''
- add.w (a0)+,d0 ; ''
- add.w (a0)+,d0 ; ''
- add.w (a0)+,d0 ; ''
- dbf d6,.loop_main ; repeat until all main block sections are done
- dbf d7,.loop_main ; ''
- subq.w #1,d5 ; decrease remaining nybble for dbf
- bpl.s .done ; if there is no remaining nybble, branch
- .loop_extra:
- add.w (a0)+,d0 ; add remaining words
- dbf d5,.loop_extra ; repeat until the remaining words are done
- .done:
- cmp.w (Checksum).w,d0 ; compare correct checksum to the one in ROM
- bne.w ChecksumError ; if they don't match, branch
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement