HALICERY

free-time coding, hardware dev, articles

Top
Home 8042 Blogs About
Home IntelEssential 16/32-bit Instructions XLAT

Last modified: Thu Jun 18 17:39:06 UTC+0200 2026 © A. Tarpai


8086 XLAT

A one-byte opcode instruction D7 to translate byte in AL. Convert unsigned byte-index (AL) to byte from table pointed by DS:BX. Segment override possible.

Equivalent to:

MOV AL, DS:[BX + unsigned AL]

386 XLAT

Same one-byte opcode instruction: D7 XLAT – but honors address-size.

Segment override assembly syntax. Eg.:

VC++ assembly syntax:                  NASM syntax:

xlat byte ptr es:[ebx]                 es xlat

66h has no effect (tested), only 8-bit move.

Address-size determines portion of EBX to use:

1. Effective address calculation: unsigned addition

        address-size = 32                   address-size = 16
        D=1 or D=0 and 67h                  D=0 or D=1 and 67h

        OFFSET = EBX + AL                   OFFSET = BX + AL



        31                  0               31                  0
        +--------------+----+               +--------------+----+
        | . . . . . .  | AL | EAX           | . . . . . .  | AL | EAX
        +--------------+----+               +--------------+----+
        +-------------------+               +---------+---------+
        |        EBX        | EBX           | . . . . |    BX   | EBX
    +   +-------------------+           +   +---------+---------+
   ___________________________         ___________________________
        +-------------------+               +---------+---------+
        |                   |               | 0 0 0 0           |
        +-------------------+               +---------+---------+
            32-bit OFFSET                       16-bit OFFSET

        +-------------------+               +-------------------+
        |    (DS)-BASE      |               |    (DS)-BASE      |
    +   +-------------------+           +   +-------------------+
   ___________________________         ___________________________
        +-------------------+               +-------------------+
        |                   |               |                   |
        +-------------------+               +-------------------+
          EFFECTIVE ADDRESS                   EFFECTIVE ADDRESS


2. Move memory byte [EA] into AL

       +--------------+----+               +--------------+----+
       | . . . . . .  | m8 | EAX           | . . . . . .  | m8 | EAX
       +--------------+----+               +--------------+----+
                        AL                                  AL

   (.) is don't care and unchanged