7Ch UT$XTOB convert numer to hex string
Input X register - Address of destination buffer.
D register - Unsigned binary number for conversion.
Output B register - Length of converted ascii buffer.

Converts the unsigned binary number in D to ASCII hexidecimal in the buffer at X, returning the length of the buffer in B.

Register X is preserved.


Convert 2475 to count-preceded ASCII hexidecimal buffer.
Resulting bytes are: 3,'9','A','B' at BUFFER-1.

        LDX     #BUFFER
        LDD     #2475           ; 2475 decimal = $9AB
        OS      UT$UTOB         ; preserves X
        DEX                     ; point one before BUFFER
        STAB    0,X            ; length into count-byte
Errors - none -