Translate                                  

86/88

Y

186

Y

286

Y

386

Y

486

Y

XLAT translate_table

Ovfl

N

Dir

N

Int

N

Trap

N

Sign

N

Zero

N

Aux

N

Prty

N

Carry

N

    XLAT translates bytes via a table lookup. A pointer to a 256-byte
    translation table is loaded into BX. The byte to be translated is
    loaded into AL; it serves as an index (ie, offset) into the
    translation table. After the XLAT instruction is executed, the byte in
    AL is replaced by the byte located AL bytes from the beginning of the
    translate-table.

       Notes:         Translate-table can be less than 256 bytes.

                      The operand, translate-table, is optional since a
                      pointer to the table must be loaded into BX before
                      the instruction is executed.

    The following example translates a decimal value (0 to 15) to the
    corresponding single hexadecimal digit.

            lea     bx, hex_table           ;pointer to table into BX
            mov     al, decimal_digit       ;digit to be translated to AL
            xlat    hex_table               ;translate the value in AL
               .                            ;AL now contains ASCII hex digit
               .
    hex_table       db      '0123456789ABCDEF'

------------------------------------ Timing ----------------------------------

OpCode          Instruction             386     286     86
D7              XLAT m8                 5       5       11

------------------------------------ Logic -----------------------------------

        AL = (BX + AL)

See Also MOV


Copyright © 1985 to 2022 Beta Systems                            Last modified: Wednesday, January 05, 2022 .