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.
X1
Acc.
6500 3544
V1400
3544
SP60
C30
OUT
V1401
6500
Acc.
5500 3544
V1410
3544
V1411
5500
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
ENTSHFT
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
DirectSOFT
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