Prev: 28227 Up: Map Next: 28363
28354: Divide By Thirty-Two
Used by the routine at HandlerAccelerate.
Shifts HL right by five bits, which divides it by 32.
Input
HL Value
Output
HL Value divided by 32
DivideByThirtyTwo 28354 LD B,5 Set the shift counter to 5.
DivideByThirtyTwo_Loop 28356 SRL H Shift H right, moving bit 0 into the carry flag.
28358 RR L Rotate the carry flag into L from the top.
28360 DJNZ DivideByThirtyTwo_Loop Decrease the shift counter by one and loop back to DivideByThirtyTwo_Loop until all five shifts have been done.
28362 RET Return.
Prev: 28227 Up: Map Next: 28363