* better
[mascara-docs.git] / hw / i386.reference / XLAT.htm
blob18d149d3437b5e0d0875568ba092b95ad4e75d7b
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>80386 Programmer's Reference Manual -- Opcode XLAT</TITLE>
5 </HEAD>
6 <BODY>
7 <B>up:</B> <A HREF="c17.htm">
8 Chapter 17 -- 80386 Instruction Set</A><BR>
9 <B>prev:</B><A HREF="XCHG.htm"> XCHG Exchange Register/Memory with Register</A><BR>
10 <B>next:</B><A HREF="XOR.htm"> XOR Logical Exclusive OR</A>
11 <P>
12 <HR>
13 <P>
14 <H1>XLAT/XLATB -- Table Look-up Translation</H1>
16 <PRE>
17 D7 XLAT m8 5 Set AL to memory byte DS:[(E)BX + unsigned AL]
18 D7 XLATB 5 Set AL to memory byte DS:[(E)BX + unsigned AL]
19 </PRE>
21 <H2>Operation</H2>
23 <PRE>
24 IF AddressSize = 16
25 THEN
26 AL := (BX + ZeroExtend(AL))
27 ELSE (* AddressSize = 32 *)
28 AL := (EBX + ZeroExtend(AL));
29 FI;
30 </PRE>
32 <H2>Description</H2>
34 XLAT changes the AL register from the table index to the table entry. AL
35 should be the unsigned index into a table addressed by DS:BX (for an
36 address-size attribute of 16 bits) or DS:EBX (for an address-size attribute
37 of 32 bits).
38 <P>
39 The operand to XLAT allows for the possibility of a segment override. XLAT
40 uses the contents of BX even if they differ from the offset of the operand.
41 The offset of the operand should have been moved intoBX/EBX with a previous
42 instruction.
43 <P>
44 The no-operand form, XLATB, can be used if the BX/EBX table will always
45 reside in the DS segment.
47 <H2>Flags Affected</H2>
49 None
51 <H2>Protected Mode Exceptions</H2>
53 #GP(0) for an illegal memory operand effective address in the CS, DS, ES,
54 FS, or GS segments; #SS(0) for an illegal address in the SS segment;
55 #PF(fault-code) for a page fault
57 <H2>Real Address Mode Exceptions</H2>
59 Interrupt 13 if any part of the operand would lie outside of the effective
60 address space from 0 to 0FFFFH
62 <H2>Virtual 8086 Mode Exceptions</H2>
64 Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault
67 <P>
68 <HR>
69 <P>
70 <B>up:</B> <A HREF="c17.htm">
71 Chapter 17 -- 80386 Instruction Set</A><BR>
72 <B>prev:</B><A HREF="XCHG.htm"> XCHG Exchange Register/Memory with Register</A><BR>
73 <B>next:</B><A HREF="XOR.htm"> XOR Logical Exclusive OR</A>
74 </BODY>