The LazyBoy Library Manual - ByteToHex

Part of the Number Conversions group.

%imacro ByteToHex 2
Prefers: ES:DI, AL
Prefers: DI, AL

Convert a byte to a hexadecimal ASCIIZ string.

The destination buffer must be at least 3 bytes. 2 for the hexadecimal characters and 1 for the null terminated ASCIIZ string. (range 00..FF)

If the destination pointer does not provide a segment register, ES is assumed.

If a Code Label is provided for the destination pointer, then CS is assumed.

Examples:

    ByteToHex   es:di, al       ; convert al to hex, store at es:di
    ByteToHex   di, cl          ; convert cl to hex, store at es:di
    ByteToHex   ds:si, ah       ; convert ah to hex, store at ds:si
    ByteToHex   MY_BUF, bl      ; convert bl to hex, store at cs:MY_BUF
    ByteToHex   MY_BUF, [si]    ; convert byte at [ds:si] to hex, store
                                ; at memory location cs:MY_BUF