Chapter 5: Standard RLL Instructions - Logical
And with Stack (ANDS)
1
The And with Stack instruction is a 32-bit instruction that
230
logically ANDs the value in the accumulator with the first level
240
of the accumulator stack. The result resides in the accumulator.
2
The value in the first level of the accumulator stack is removed
250-1
from the stack and all values are moved up one level. Discrete
260
3
status flags indicate if the result of the And with Stack is zero
or a negative number (the most significant bit is on).
DS
Used
4
HPP Used
SP63
SP70
5
NOTE: Status flags are valid only until another instruction uses the same flag.
6
In the following example, when X1 is on, the binary value in the accumulator will be anded
with the binary value in the first level of the accumulator stack. The result resides in the
7
accumulator. The 32 bit value is then output to V1500 and V1501.
8
DirectSOFT
9
X1
Load the value in V1400 and
10
1401 into the accumulator
11
AND the value in the
12
accumulator with the
first level of the
accumulator stack
13
Copy the value in the
accumulator to V1500
14
and 1501
Handheld Programmer Keystrokes
$
B
A
STR
1
L
D
SHFT
ANDST
3
B
V
S
SHFT
AND
RST
GX
D
SHFT
OUT
3
C
D
5–74
DL205 User Manual, 4th Edition, Rev. B
Discrete Bit Flags
LDD
V1400
Acc.
ANDS
Acc.
36476A38
(top of stack)
AND
Acc.
OUTD
V1500
ENT
D
B
E
A
3
1
4
ENT
B
F
A
A
1
5
0
Will be on if the result in the accumulator is zero
Will be on if the result in the accumulator is negative
V1401
5
4
7
E
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0
1
0 1
0
1
0
0 0
1
1
1
0
1
0 1
0
1
0
0 0
1
1
1
0
0
1
1
0 1
1
0
0
1 0
0
0
0
0
0
0 1
0 0
0
0
1
1
0
0
0 0
0 0
1
0
0
0
0
0
1
4
4
6
V1501
A
ENT
0
0
ENT
0
ANDS
Description
V1400
2
8
15 14 13 12 11 10 9
8 7
1 1
1
0
0
0
1 0
1
0
0
0 0
1 1
1
0
0
0
1 0
1
0
0
0 0
0
1
1 1
0
1
1
0
1 0
1
0
0 0
0 1
0
1
0
0
0
0
1 0
1
0
0
0 0
2
8
V1500
7
A
6 5
4 3
2
1
0
1
1
1
1 0
1
0
1
1
1
1 0
1
0
0
0 1
1
1
0
0 0
0
1
1
1 0
0
0
3
8
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?