The LazyBoy Library Manual - ByteToBin

Part of the Number Conversions group.

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

Convert a byte to a binary ASCIIZ string.

The destination buffer must be at least 9 bytes. 8 for the binary characters and 1 for the null terminated ASCIIZ string.

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:

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