Prev: BFB0 Up: Map Next: BFC6
BFBB: Make One Decimal Digit
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 BFBB LD C,$2F Start at one below the ASCII code for 0.
MakeOneDecimalDigit_Loop BFBD INC C Keep subtracting this power of ten, counting the digit up in C, until HL goes below zero.
BFBE AND A
BFBF SBC HL,DE
BFC1 JR NC,MakeOneDecimalDigit_Loop
BFC3 ADD HL,DE Add back the last power of ten to leave the remainder.
BFC4 LD A,C Put the digit in A.
BFC5 RET Return.
Prev: BFB0 Up: Map Next: BFC6