2 Instructions
2-106 CP1E CPU Unit Instructions Reference Manual(W483)
Function
ZCP
ZCP(088) compares the 16-bit signed binary data in CD with the range defined by LL and UL and out-
puts the result to the Greater Than, Equals, and Less Than Flags in the Auxiliary Area. (The Less Than
or Equal, Greater Than or Equal, and Not Equal Flags are left unchanged.)
When CD > UL as shown below, the > flag turns ON.
When LL CD UL, the = flag turns ON. When CD < LL, the < flag turns ON.
ZCPL
ZCPL(116) compares the 32-bit signed binary data in CD+1, CD with the range defined by LL+1, LL
and UL+1, UL and outputs the result to the Greater Than, Equals, and Less Than Flags in the Auxiliary
Area. (The Less Than or Equal, Greater Than or Equal, and Not Equal Flags are left unchanged.)
When CD+1,CD > UL+1,UL as shown below, the > flag turns ON.
When LL+1,LL CD+1, CD UL+1, UL, the = flag turns ON.
When CD+1, CD < LL+1, LL, the < flag turns ON.
Precautions
When ZCP(088)/ZCPL(116) is executed, the result is reflected in the Arithmetic Flags. Control the
desired output or right-hand instruction with a branch from the same input condition that controls
ZCP(088)/ZCPL(116), as shown in the following diagram.
ZCP(088)Result Flag status
> = <
CD > UL ON OFF OFF
CD = UL OFF ON
LL < CD < UL
CD = LL
CD < LL OFF ON
ZCPL(116)Result Flag status
> = <
CD+1, CD > UL+1, UL ON OFF OFF
CD+1, CD = UL+1, UL OFF ON
LL+1, LL < CD+1, CD <
UL+1, UL
CD+1, CD = LL+1, LL
CD+1, CD < LL+1, LL OFF ON
A
ZCP
CD
LL
UL
Arithmetic Flag
(Example: Equal Flag)
In this case, the Equals Flag and output A will be
turned ON when LL CD UL.