281
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Comparison Instructions
3
ZCPS/ZCPSL
Function
z ZCPS
ZCPS(117) compares the 16-bit signed binary data in CD with the range defined by LL and UL and
outputs the result to the Arithmetic Flags.
z ZCPSL
ZCPSL(118) 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 Arithmetic Flags.
Comparison Result and Flag Operation
Each flag shown below is ON when CD is on the bold lines or the filled circles.
Less Than Flag P_LT • ON if CD < LL.
• OFF in all other cases.
• ON if CD+1, CD < LL+1, LL.
• OFF in all other cases.
Less Than or Equal Flag P_LE • ON if CD ≤ UL.
• OFF in all other cases.
• ON if CD+1, CD ≤ UL+1, UL.
• OFF in all other cases.
Negative Flag P_N Held Held
Result
Greater
Than Flag
Equals Flag
Less Than
Flag
Greater Than or
Equals Flag* (AND
of Greater Than Flag
and Equals Flag)
Less Than or Equals
Flag* (AND of Less
Than Flag and
Equals Flag)
Not Equals Flag*
(AND of Greater
Than Flag and Less
Than Flag)
CD > UL ON OFF OFF ON OFF ON
CD = UL OFF ON ON OFF
LL < CD < UL
CD = LL
CD < LL OFF ON OFF ON
Name Label
Operation
ZCP ZCPL
CD
LL UL
LL UL
CD
CD
LL UL
LL UL
CD
LL UL
CD
LL UL
LL UL
LL UL
LL UL
LL UL
LL UL
Greater Than Flag
Equals Flag
Less Than Flag
Greater Than or Equals Flag*
Less Than or Equals Flag*
Not Equals Flag*