EasyManua.ls Logo

ST ST10 Series - Page 153

ST ST10 Series
197 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
PROGRAMMING MANUAL CoCMP
153/197
CoCMP Compare
Group Compare Instructions
Syntax CoCMP op1, op2
Operation tmp <-- (op2)\(op1)
(ACC) <--> (tmp)
Data Types DOUBLE WORD
Description Subtracts a 40-bit signed operand from the 40-bit Accumulator
content and update the N, Z and C flags contained in the MSW
register leaving the accumulator unchanged. The 40-bit operand
results from the concatenation, “\”, of the two source operands op1
(LSW) and op2 (MSW) which is then sign-extended. The MS bit of the
MCW register does not affect the result. This instruction is not repeat
-
able and allows up to two parallel memory reads.
MAC Flags
N Set if the most significant bit of the result is set. Cleared
otherwise.
Z Set if the result equals zero. Cleared otherwise.
C Set if a borrow is generated. Cleared otherwise.
SV Not affected.
E Not affected.
SL Not affected.
Addressing Modes
Examples
N Z C SV E SL
* * * - - -
Mnemonic Rep Format Bytes
CoCMP Rw
n
, Rw
m
No A3 nm C2 00 4
CoCMP [IDX
i
], [Rw
m
 No 93 Xm C2 0:0qqq 4
CoCMP Rw
n
, [Rw
m
 No 83 nm C2 0:0qqq 4
CoCMP [IDX1+QX0], [R11+QR1] ; MSW(N,Z,C)<--(ACC) - ((R11))\((IDX1))
; (R11) <-- (R11) + (QR1)
; (IDX1) <-- (IDX1) + (QX0)
CoCMP R1, [R2-] ; MSW(N,Z,C) <-- (ACC) - ((R2))\(R1)
; (R2) <-- (R2) - 2
CoCMP R2, R5 ; MSW(N,Z,C) <-- (ACC) - (R5)\(R2)
2