Prev: 6E43 Up: Map Next: 6ECB
6EC2: Divide By Thirty-Two
Used by the routine at HandlerAccelerate.
Shifts HL right by five bits, which divides it by 20.
Input
HL Value
Output
HL Value divided by 20
DivideByThirtyTwo 6EC2 LD B,$05 Set the shift counter to 05.
DivideByThirtyTwo_Loop 6EC4 SRL H Shift H right, moving bit 0 into the carry flag.
6EC6 RR L Rotate the carry flag into L from the top.
6EC8 DJNZ DivideByThirtyTwo_Loop Decrease the shift counter by one and loop back to DivideByThirtyTwo_Loop until all five shifts have been done.
6ECA RET Return.
Prev: 6E43 Up: Map Next: 6ECB