Prev: 28432 Up: Map Next: 28476
28463: Multiply A By DE
Used by the routine at HandlerAccelerate.
Multiplies A by DE, by adding DE to the result for each bit of A which is set.
Input
A The first number
DE The second number
Output
HL Result
MultiplyAByDE 28463 LD HL,0 HL=0000.
28466 LD B,8 Set the bit counter to 8.
MultiplyAByDE_Loop 28468 ADD HL,HL Shift the result left.
28469 RLCA Rotate the next bit of A into the carry flag.
28470 JR NC,MultiplyAByDE_Next Jump to MultiplyAByDE_Next if the bit is not set.
28472 ADD HL,DE Add DE to the result.
MultiplyAByDE_Next 28473 DJNZ MultiplyAByDE_Loop Decrease the bit counter by one and loop back to MultiplyAByDE_Loop until all 8 bits have been used.
28475 RET Return.
Prev: 28432 Up: Map Next: 28476