![]() |
Routines |
| Prev: 49072 | Up: Map | Next: 49094 |
|
Used by the routine at ConvertNumberToString.
Subtracts one power of ten until the number goes below zero, then adds that power back and returns the ASCII digit.
|
||||
| MakeOneDecimalDigit | 49083 | LD C,47 | Start at one below the ASCII code for 0. | |
| MakeOneDecimalDigit_Loop | 49085 | INC C | Keep subtracting this power of ten, counting the digit up in C, until HL goes below zero. | |
| 49086 | AND A | |||
| 49087 | SBC HL,DE | |||
| 49089 | JR NC,MakeOneDecimalDigit_Loop | |||
| 49091 | ADD HL,DE | Add back the last power of ten to leave the remainder. | ||
| 49092 | LD A,C | Put the digit in A. | ||
| 49093 | RET | Return. | ||
| Prev: 49072 | Up: Map | Next: 49094 |