Prev: CE06 Up: Map Next: CE1C
CE0D: HL = DE * A
Used by the routine at VFLIP_SPRITE_DATA.
Shift and add, taking the bits of A from the top; eight RLCAs bring A back to what it was, and BC is kept. Used only to find the length of a sprite's data (VFLIP_SPRITE_DATA). As Knight Lore's HL_equals_DE_x_A.
Input
DE the multiplicand
A the multiplier
Output
HL the product
HL_EQUALS_DE_X_A CE0D PUSH BC
CE0E LD HL,$0000 HL = 0; eight bits
CE11 LD B,$08
HL_EQUALS_DE_X_A_0 CE13 ADD HL,HL Double the total, and add DE if the next bit of A is set
CE14 RLCA
CE15 JR NC,HL_EQUALS_DE_X_A_1
CE17 ADD HL,DE
HL_EQUALS_DE_X_A_1 CE18 DJNZ HL_EQUALS_DE_X_A_0
CE1A POP BC
CE1B RET
Prev: CE06 Up: Map Next: CE1C