It should work, but it's limited to working on only one byte of data.
For arbitrary lengths of digits, setting up a loop using DIV and MOD is somewhat more elegant.
Example for an 8-digit display:
Output is stored in an 8-byte buffer, input is either decimal or binary (use 16 for division instead).
Input value: 12345678. digit_1 is LSD
digit_1 = input MOD(10) ;(=8)
input = input DIV(10) ;(=1234567)
digit_2 = input MOD(10) ;(=7)
input = input DIV(10) ;(=12345)
and so on. This can be done in a loop with the loop counter used as pointer to the output array. The method can be used for any change of base.
For a single-byte conversion, yours is probably much faster.