Chapter 5: Standard RLL Instructions - Logical
Compare with Stack (CMPS)
1
The Compare with Stack instruction is a 32-bit
230
instruction that compares the value in the
240
accumulator with the value in the first level of the
2
250-1
accumulator stack.
260
The corresponding status flag will be turned on
3
indicating the result of the comparison. This does
DS
Used
not affect the value in the accumulator.
HPP Used
4
SP60
5
SP61
SP62
6
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
7
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
8
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
9
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.
10
DirectSOFT
X1
11
12
13
14
SP60
A
Handheld Programmer Keystrokes
$
B
STR
SHFT
C
SHFT
SHFT
D
$
STR
GX
OUT
5–86
DL205 User Manual, 4th Edition, Rev. B
Discrete Bit Flags
On when the value in the accumulator is less than the instruction value.
On when the value in the accumulator is equal to the instruction value.
On when the value in the accumulator is greater than the instruction value.
LDD
V1400
LDD
V1410
CMPS
C30
OUT
B
ENT
1
L
D
D
ANDST
3
3
L
D
D
ANDST
3
3
C
M
P
SHFT
2
ORST
CV
SP
G
SHFT
STRN
6
C
D
SHFT
2
3
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
B
E
A
A
1
4
0
0
B
E
B
A
1
4
1
0
S
ENT
RST
A
ENT
0
A
ENT
0
C MP S
Description
V1401
V1400
6
5
0
0
3
5
6
5
0
0
3
5
Acc.
V1411
V1410
5
5
0
0
3
5
Acc. 5
5
0
0
3
5
Compared with
Top of Stack
ENT
ENT
4
4
4
4
4
4
4
4
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?