The hexadecimal to decimal subroutine (in short HexToDec) which converts a hexadecimal 8-bit value into a decimal string. To use for JSL, use JSL $00974C instead.
Input:
-A: 8-bit value to convert
Output:
-A: 1s digit (calculated via repeated subtraction until < 10; “modulo” by 10)
-X: 10s digit (calculated via how many subtraction until A < 10; “quotient” division by 10)