![]() |
Routines |
| Prev: D02C | Up: Map | Next: D04B |
|
Multiplies A by DE.
|
||||||||||||||
|
Start with a product of zero, and count eight bits.
|
||||||||||||||
| MultiplyAByDE | D03E | LD HL,$0000 | Set the product to 00. | |||||||||||
| D041 | LD B,$08 | Set a count of 08. | ||||||||||||
|
Double the product, and add DE if the next bit of A is set.
|
||||||||||||||
| MultiplyAByDE_Bit | D043 | ADD HL,HL | Double the product. | |||||||||||
| D044 | RLCA | Move the next bit of the first number into the carry flag. | ||||||||||||
| D045 | JR NC,MultiplyAByDE_Next | Jump to MultiplyAByDE_Next if it is not set. | ||||||||||||
| D047 | ADD HL,DE | Add the second number. | ||||||||||||
|
Count down the bits.
|
||||||||||||||
| MultiplyAByDE_Next | D048 | DJNZ MultiplyAByDE_Bit | Jump to MultiplyAByDE_Bit until all the bits are done. | |||||||||||
| D04A | RET | Return. | ||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: D02C | Up: Map | Next: D04B |