STMicroelectronics ST10 Series Programming Manual page 67

Table of Contents

Advertisement

CMPI1
Syntax
Operation
Data Types
Description
This instruction is used to enhance the performance and flexibility of loops. The source operand specified
by op1 is compared to the source operand specified by op2 by performing a 2's complement binary sub-
traction of op2 from op1. Operand op1 may specify ONLY GPR registers. Once the subtraction has com-
pleted, the operand op1 is incremented by one. Using the set flags, a branch instruction can then be used
in conjunction with this instruction to form common high level language FOR loops of any range.
Flags
E
*
E
Set if the value of op2 represents the lowest possible negative number. Cleared otherwise.
Used to signal the end of a table.
Z
Set if result equals zero. Cleared otherwise.
V
Set if an arithmetic underflow occurred, i.e. the result cannot be represented in the specified
data type. Cleared otherwise.
C
Set if a borrow is generated. Cleared otherwise.
N
Set if the most significant bit of the result is set. Cleared otherwise.
Addressing Modes
Mnemonic
CMPI1
CMPI1
CMPI1
Integer Compare & Increment by 1
CMPI1
op1, op2
(op1)
(op1)
WORD
Z
*
Rw
, #data
n
4
Rw
, #data
n
16
Rw
, mem
n
ST10 FAMILY PROGRAMMING MANUAL
<--> (op2)
<-- (op1) + 1
V
*
Format
80 #n
86 Fn ## ##
82 Fn MM MM
C
N
S
*
Bytes
2
4
4
65/172

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ST10 Series and is the answer not in the manual?

Questions and answers

Table of Contents