Prev: E0E5 Up: Map Next: E0FB
E0EE: Multiply A By DE
Used by the routine at FlipSprite.
Multiplies A by DE.
Input
A The first number
DE The second number
Output
HL The product
Clear the product and count the bits.
MultiplyAByDE E0EE LD HL,$0000 Set HL to 0000.
E0F1 LD B,$08 Set B to 08.
Shift the product and add when the next bit is set.
MultiplyAByDE_Loop E0F3 ADD HL,HL Double HL.
E0F4 RLCA Jump to MultiplyAByDE_Next if the carry flag is not set.
E0F5 JR NC,MultiplyAByDE_Next
E0F7 ADD HL,DE Add DE to HL.
MultiplyAByDE_Next E0F8 DJNZ MultiplyAByDE_Loop Loop back until all the bits have been used.
E0FA RET Return.
Prev: E0E5 Up: Map Next: E0FB