3-6
INSTRUCTION SET REFERENCE
3.1.2.Operation
The Operation section contains an algorithmic description (written in pseudo-code) of the
instruction. The pseudo-code uses a notation similar to the Algol or Pascal language. The algo-
rithms are composed of the following elements:
Comments are enclosed within the symbol pairs (* and *).
Compound statements are enclosed in keywords, such as IF, THEN, ELSE, and FI for an if
statement, DO and OD for a do statement, or CASE ... OF and ESAC for a case statement.
A register name implies the contents of the register. A register name enclosed in brackets
implies the contents of the location whose address is contained in that register. For
example, ES:[DI] indicates the contents of the location whose ES segment relative address
is in register DI. [SI] indicates the contents of the address contained in register SI relative
to SIs default segment (DS) or overridden segment.
Parentheses around the E in a general-purpose register name, such as (E)SI, indicates
that an offset is read from the SI register if the current address-size attribute is 16 or is read
from the ESI register if the address-size attribute is 32.
Brackets are also used for memory operands, where they mean that the contents of the
memory location is a segment-relative offset. For example, [SRC] indicates that the
contents of the source operand is a segment-relative offset.
A
<
B; indicates that the value of B is assigned to A.
The symbols =,
?
,
?
, and
?
are relational operators used to compare two values, meaning
equal, not equal, greater or equal, less or equal, respectively. A relational expression such
as A = B is TRUE if the value of A is equal to B; otherwise it is FALSE.
The expression << COUNT and >> COUNT indicates that the destination operand
should be shifted left or right, respectively, by the number of bits indicated by the count
operand.
The following identifiers are used in the algorithmic descriptions:
OperandSize and AddressSizeThe OperandSize identifier represents the operand-size
attribute of the instruction, which is either 16 or 32 bits. The AddressSize identifier
represents the address-size attribute, which is either 16 or 32 bits. For example, the
following pseudo-code indicates that the operand-size attribute depends on the form of the
CMPS instruction used.
IF instruction = CMPSW
THEN OperandSize
<
16;
ELSE
IF instruction = CMPSD
THEN OperandSize
<
32;
FI;
FI;