
2-3
2
PRELIMINARY
Instruction Set Overview
2.2
Instruction Set
Overview
The M II CPU instruction set performs ten
types of general operations:
All M II CPU instructions operate on as few as
zero operands and as many as three operands.
An NOP instruction (no operation) is an exam-
ple of a zero operand instruction. Two operand
instructions allow the specification of an
explicit source and destination pair as part of
the instruction. These two operand instruc-
tions can be divided into eight groups accord-
ing to operand types:
An operand can be held in the instruction itself
(as in the case of an immediate operand), in one
of the processor’s registers or I/O ports, or in
memory. An immediate operand is prefetched
as part of the opcode for the instruction.
Operand lengths of 8, 16, or 32 bits are sup-
ported as well as 64-or 80-bit associated with
floating point instructions. Operand lengths of
8 or 32 bits are generally used when executing
code written for 386- or 486-class (32-bit code)
processors. Operand lengths of 8 or 16 bits are
generally used when executing existing 8086 or
80286 code (16-bit code). The default length
Arithmetic
High-Level Language Support
Bit Manipulation Operating System Support
Control Transfer Shift/Rotate
Data Transfer
String Manipulation
Floating Point
MMX Instructions
Register to Register
Register to I/O
Register to Memory
I/O to Register
Memory to Register
Immediate Data to Register
Memory to Memory
Immediate Data to Memory
of an operand can be overridden by placing one
or more instruction prefixes in front of the
opcode. For example, by using prefixes, a
32-bit operand can be used with 16-bit code, or
a 16-bit operand can be used with 32-bit code.
Chapter 6 of this manual lists each instruction
in the M II CPU instruction set along with the
associated opcodes, execution clock counts,
and effects on the FLAGS register.
2.2.1
Lock Prefix
The LOCK prefix may be placed before certain
instructions that read, modify, then write back
to memory. The prefix asserts the LOCK# sig-
nal to indicate to the external hardware that the
CPU is in the process of running multiple indi-
visible memory accesses. The LOCK prefix can
be used with the following instructions:
Bit Test Instructions (BTS, BTR, BTC)
Exchange Instructions (XADD, XCHG,
CMPXCHG)
One-operand Arithmetic and Logical
Instructions (DEC, INC, NEG, NOT)
Two-operand Arithmetic and Logical
Instructions (ADC, ADD, AND, OR, SBB,
SUB, XOR).
An invalid opcode exception is generated if the
LOCK prefix is used with any other instruction,
or with the above instructions when no write
operation to memory occurs (i.e., the
destination is a register). The LOCK# signal
can be negated to allow weak-locking for all of
memory or on a regional basis. Refer to the
descriptions of the NO-LOCK bit (within
CCR1) and the WL bit (within RCRx) later in
this chapter.