DL205 User Manual, 4th Edition, Rev. B
5–86
Chapter 5: Standard RLL Instructions - Logical
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Compare with Stack (CMPS)
The Compare with Stack instruction is a 32-bit
instruction that compares the value in the
accumulator with the value in the first level of the
accumulator stack.
The corresponding status flag will be turned on
indicating the result of the comparison. This does
not affect the value in the accumulator.
NOTE:
Status flags are valid only until another instruction uses the same flag.
In the following example when X1 is on, the value in V1400 and V1401 is loaded into the
accumulator using the Load Double instruction. The value in V1410 and V1411 is loaded
into the accumulator using the Load Double instruction. The value that was loaded into the
accumulator from V1400 and V1401 is placed on top of the stack when the second Load
instruction is executed. The value in the accumulator is compared with the value in the first
level of the accumulator stack using the CMPS instruction. The corresponding discrete status
flag will be turned on indicating the result of the comparison. In this example, if the value in
the accumulator is less than the value in the stack, SP60 will turn on, energizing C30.
C
M
P
S
ý
ý
ý
þ
230
240
2
5
0
-1
2
6
0
X1
Acc. 6 5 0 0
3 5 4 4
V1400
3 5 4 4
SP60
C30
OUT
V1401
6 5 0 0
Acc. 5 5 0 0
3 5 4 4
V1410
3 5 4 4
V1411
5 5 0 0
Handheld Programmer Keystrokes
STR
$
SHFT
ANDST
L
3
D
SHFT
2
C
ORST
M
CV
P
STR
$
STRN
SP
OUT
GX
3
D
RST
S
1
B
ENT
ENT
SHFT
1
B
4
E
0
A
0
A
ENT
SHFT
ANDST
L
3
D
3
D
1
B
4
E
1
B
0
A
ENT
SHFT
Compared with
Top of Stack
LDD
V1400
LDD
V1410
CMPS
Load the value in V1400 and
V1401 into the accumulator
Load the value in V1410 and
V1411 into the accumulator
Compare the value in the
accumulator with the value
in the first level of the
accumulator stack
Direct
SOFT
ENT
0
A
SHFT
2
C
3
D
0
A
6
G
ENT
Discrete Bit Flags
Description
SP60
On when the value in the accumulator is less than the instruction value.
SP61
On when the value in the accumulator is equal to the instruction value.
SP62
On when the value in the accumulator is greater than the instruction value.
DS
Used
HPP Used