
376 EMBEDDED PROCESSOR
16-Bit Extensions of the
Instruction Set
Two prefixes, the operand size prefix (66H) and the
effective address size prefix (67H), allow overriding
individually the default selection of operand size and
effective address size. These prefixes may precede
any opcode bytes and affect only the instruction
they precede. If necessary, one or both of the prefix-
es may be placed before the opcode bytes. The
presence of the operand size prefix (66H) and the
effective address prefix will allow 16-bit data opera-
tion and 16-bit effective address calculations.
For instructions with more than one prefix, the order
of prefixes is unimportant.
Unless specified otherwise, instructions with 8-bit
and 16-bit operands do not affect the contents of
the high-order bits of the extended registers.
Encoding of Instruction Fields
Within the instruction are several fields indicating
register selection, addressing mode and so on.
ENCODING OF OPERAND LENGTH (w) FIELD
For any given instruction performing a data opera-
tion, the instruction will execute as a 32-bit opera-
tion. Within the constraints of the operation size, the
w field encodes the operand size as either one byte
or the full operation size, as shown in the table be-
low.
w Field
Operand Size
with 66H Prefix
Normal
Operand Size
0
1
8 Bits
16 Bits
8 Bits
32 Bits
ENCODING 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 r/m’’ byte, or as the r/m
field of the ‘‘mod r/m’’ byte.
Encoding of reg Field When w Field
is not Present in Instruction
Register Selected
with 66H Prefix
Register Selected
During 32-Bit
Data Operations
reg Field
000
001
010
011
100
101
110
111
AX
CX
DX
BX
SP
BP
SI
DI
EAX
ECX
EDX
EBX
ESP
EBP
ESI
EDI
Encoding of reg Field When w Field
is Present in Instruction
Register Specified by reg Field
with 66H Prefix
reg
Function of w Field
(when w
e
0)
(when w
e
1)
000
001
010
011
100
101
110
111
AL
CL
DL
BL
AH
CH
DH
BH
AX
CX
DX
BX
SP
BP
SI
DI
Register Specified by reg Field
without 66H Prefix
reg
Function of w Field
(when w
e
0)
(when w
e
1)
000
001
010
011
100
101
110
111
AL
CL
DL
BL
AH
CH
DH
BH
EAX
ECX
EDX
EBX
ESP
EBP
ESI
EDI
88