User:Qalle/Algorithms
From NESdev Wiki
Jump to navigationJump to search
Miscellaneous algorithms that may be useful on the NES.
8-bit unsigned integer to 3 decimal ASCII digits
Source: [1]
; in: A = unsigned integer ; out: Y/X/A = ASCII digits of hundreds/tens/ones ldy #$2f ; ASCII("0") - 1 ldx #$3a ; ASCII("9") + 1 sec - iny sbc #100 bcs - - dex adc #10 bmi - adc #$2f ; ASCII("0")
References
- ↑ Tiny .A to ASCII routine, Codebase64