www.national.com
208
Revision 1.2
Instruction Set (
Continued
)
G
7.1.1
Prefix bytes can be placed in front of any instruction to
modify the operation of that instruction. When more than
one prefix is used, the order is not important. There are
five types of prefixes that can be used:
Prefix (Optional)
1.
Segment Override explicitly specifies which segment
register the instruction will use for effective address
calculation.
2.
Address Size switches between 16-bit and 32-bit
addressing by selecting the non-default address size.
3.
Operand Size switches between 16-bit and 32-bit
operand size by selecting the non-default operand
size.
4.
Repeat is used with a string instruction to cause the
instruction to be repeated for each element of the
string.
5.
Lock is used to assert the hardware LOCK# signal
during execution of the instruction.
Table 7-3 lists the encoding for different types of prefix
bytes.
7.1.2
The opcode field specifies the operation to be performed
by the instruction. The opcode field is either one or two
bytes in length and may be further defined by additional
bits in the mod r/m byte. Some operations have more than
one opcode, each specifying a different form of the opera-
tion. Certain opcodes name instruction groups. For exam-
ple, opcode 80h names a group of operations that have
an immediate operand and a register or memory operand.
The reg field may appear in the second opcode byte or in
the mod r/m byte.
Opcode
The opcode may contain w, d, s and eee opcode fields, for
example, as shown in Table 7-27 on page 217.
7.1.2.1
When used, the 1-bit w field selects the operand size dur-
ing 16-bit and 32-bit data operations. See Table 7-4.
w Field (Operand Size)
7.1.2.2
When used, the 1-bit d field determines which operand is
taken as the source operand and which operand is taken
as the destination. See Table 7-5.
d Field (Operand Direction)
Table 7-3. Instruction Prefix Summary
Prefix
Encoding
Description
ES:
26h
Override segment default, use ES
for memory operand.
Override segment default, use CS
for memory operand.
Override segment default, use SS
for memory operand.
Override segment default, use DS
for memory operand.
Override segment default, use FS
for memory operand.
Override segment default, use GS
for memory operand.
Make operand size attribute the
inverse of the default.
Make address size attribute the
inverse of the default.
Assert LOCK# hardware signal.
Repeat the following string
instruction.
Repeat the following string
instruction.
CS:
2Eh
SS:
36h
DS:
3Eh
FS:
64h
GS:
65h
Operand
Size
Address
Size
LOCK
REPNE
66h
67h
F0h
F2h
REP/REPE
F3h
Table 7-4. w Field Encoding
w
Field
Operand Size
16-Bit Data
Operations
32-Bit Data
Operations
0
1
8 bits
16 bits
8 bits
32 bits
Table 7-5. d Field Encoding
d
Field
Direction of
Operation
Source
Operand
Destination
Operand
0
Register-to-Register
or
Register-to-Memory
reg
mod r/m
or
mod ss-index-
base
reg
1
Register-to-Register
or
Memory-to-Register
mod r/m
or
mod ss-index-
base