Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <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

          Logic:    AL . (BX + AL)

    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.

  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
   translate-table             11         1        1     XLAT SINE_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'

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