Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- iAPx86 - <b>xlat translate flags: not altered</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
XLAT            Translate                            Flags: Not altered

XLAT translate_table
XLATB

        Logic   AL . [eBX + AL]

    XLAT changes the AL register from the table index to the table
    entry. AL should be the unsigned index into a table addressed by
    DS:BX (for an address-size attribute of 16 bits) or DS:EBX (for an
    address-size attribute of 32 bits).

    The operand to XLAT, translate_table, allows for the possibility
    of a segment override. XLAT uses the contents of eBX even if they
    differ from the offset of the operand. The offset of the operand
    must be loaded into eBX before the instruction is executed.

    The no-operand form, XLATB, can be used if translate_table resides
    in the DS segment.


    Note
    AL, as a byte-sized index, can address up to 256 elements of
    translate_table.


    Example:
        ; Translate decimal to hex digit
        dataseg
        hex_table db "0123456789ABCDEF"
        codeseg
        mov     bx,offset hex_table     ; Pointer to table into BX
        mov     al,11                   ; Value to be translated to AL
        xlat    [hex_table]             ; Translate the value in AL
        ; al = "B"


    Opcode      Format
    D7          XLAT m8
    D7          XLATB


    Length and timing
    Operands    Bytes   8088    186     286     386     486     Pentium
    -            1      11      11       5       5       4       4   NP

See Also: LEA

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson