![]() |
Routines |
| Prev: 52742 | Up: Map | Next: 52764 |
|
Used by the routine at FlipSprite.
Multiplies A by DE.
|
||||||||||||||
|
Clear the product and count the bits.
|
||||||||||||||
| MultiplyAByDE | 52749 | PUSH BC | Stash BC on the stack. | |||||||||||
| 52750 | LD HL,0 | Set HL to 0000. | ||||||||||||
| 52753 | LD B,8 | Set B to 8. | ||||||||||||
|
Shift the product and add when the next bit is set.
|
||||||||||||||
| MultiplyAByDE_Loop | 52755 | ADD HL,HL | Double HL. | |||||||||||
| 52756 | RLCA | Jump to MultiplyAByDE_Next if the carry flag is not set. | ||||||||||||
| 52757 | JR NC,MultiplyAByDE_Next | |||||||||||||
| 52759 | ADD HL,DE | Add DE to HL. | ||||||||||||
| MultiplyAByDE_Next | 52760 | DJNZ MultiplyAByDE_Loop | Jump to MultiplyAByDE_Loop until B is zero. | |||||||||||
| 52762 | POP BC | Restore BC from the stack. | ||||||||||||
| 52763 | RET | Return. | ||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: 52742 | Up: Map | Next: 52764 |