
80386
8.2.232-Bit Extensions of the Instruction Set
With the 80386, the 86/186/286 instruction set is extended in two orthogonal directions:
Whether the instruction defaults to operations of 16 bits or 32 bits depends on the setting of the 0 bit in the code segment descriptor, which gives the de- fault length (either 32 bits or 16 bits) for both oper- ands and effective addresses when executing that code segment. In the Real Address Mode or Virtual 8086 Mode, no code segment descriptors are used, but a 0 value of 0 is assumed internally by the 80386 when operating in those modes (for
Two prefixes, the Operand Size Prefix and the Effec- tive Address Size Prefix, allow overriding individually the Default selection of operand size and effective address size. These prefixes may precede any op- code bytes and affect only the instruction they pre- cede. If necessary, one or both of the prefixes may be placed before the opcode bytes. The presence of the Operand Size Prefix and the Effective Address Prefix will toggle the operand size or the effective address size, respectively, to the value "opposite" from the Default setting. For example, if the default operand size is for
These
Unless specified otherwise, instructions with
8.2.3 Encoding of Instruction Fields
Within the instruction are several fields indicating register selection, addreSSing mode and so on. The exact encodings of these fields are defined immedi- ately ahead.
8.2.3.1ENCODING OF OPERAND LENGTH (w)
FIELD
For any given instruction performing a data opera- tion, the instruction is executing as a
| Operand Size | Operand Size | |
wField | During 16·8it | During 32·8it | |
| Data Operations | Data Operations | |
0 | 8 Bits | 8 | Bits |
1 | 16 Bits | 32 | Bits |
8.2.3.2ENCODING OF THE GENERAL REGISTER (reg) FIELD
The general register is specified by the reg field, which may appear in the primary opcode bytes, or as the reg field of the "mod rim" byte, or as the rim field of the "mod rim" byte.
Encoding of reg Field When w Field
is not Present in Instruction
Register Selected Register Selected
reg Field During 16·8it During 32·8it Data Operations Data Operations
000 | AX | EAX |
001 | CX | ECX |
010 | OX | EDX |
011 | BX | EBX |
100 | SP | ESP |
101 | BP | EBP |
101 | SI | ESI |
101 | 01 | EDI |
Encoding of reg Field When w Field
is Present in Instruction
Register Specified by reg Field
During 16·8itData Operations:
reg | Function of w Field | ||
(when w = 0) | (when w = 1) | ||
| |||
000 | AL | AX | |
001 | CL | CX | |
010 | DL | OX | |
011 | BL | BX | |
100 | AH | SP | |
101 | CH | BP | |
110 | DH | SI | |
111 | BH | 01 | |
126