And Formatted (ANDF)
The And Formatted instruction logically ANDs the binary value in
230
the accumulator and a specified range of discrete memory bits (1 to
240
32). The instruction requires a starting location (Aaaa) and number
250-1
of bits (Kbbb) to be ANDed. Discrete status flags indicate if the
260
result is zero or a negative number (the most significant bit =1).
Operand Data Type
DS
Used
HPP Used
Inputs
Outputs
Control Relays
Stage bits
Timer bits
Counter bits
Special Relays
Global I/O
Constant
Discrete Bit Flags
SP63
SP70
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on the Load Formatted instruction loads C10–C13
(4 binary bits) into the accumulator. The accumulator contents is logically ANDed with the
bit pattern from Y20–Y23 using the And Formatted instruction. The Out Formatted
instruction outputs the accumulator's lower four bits to C20–C23.
DirectSOFT
X1
LDF
K4
Load the status of 4
consecutive bits (C10-C13)
into the accumulator
ANDF
K4
And the binary bit pattern
(Y20-Y23) with the value in
the accumulator
OUTF
K4
Copy the value in the lower
4 bits in accumulator to
C20-C23
Handheld Programmer Keystrokes
$
B
ENT
STR
1
L
D
F
SHFT
ANDST
3
5
V
F
SHFT
AND
5
GX
F
SHFT
OUT
5
A
X
Y
C
S
T
CT
SP
GX/GY
K
Will be on if the result in the accumulator is zero
Will be on if the result in the accumulator is negative
C10
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
Y20
0
0
0
Accumulator
0
0 0
Acc.
Y23
Y22
ON
OFF
AND (Y20-Y23)
C20
NEXT
NEXT
NEXT
NEXT
C
A
E
NEXT
2
0
4
C
A
PREV
PREV
2
0
Chapter 5: Standard RLL Instructions - Logical
DL250-1 Range
aaa
bbb
0–777
–
0–777
–
0–1777
–
0–1777
–
0–377
–
0–177
–
0-777
–
-
–
-
1–32
Description
The unused accumulator bits are set to zero
0 0
0
0
0
0 0
0
0
0
0 0
0
0
0
0
0 0
0
0
0
0 0
0
0
0
Y21
Y20
OFF
OFF
Acc.
B
A
E
ENT
1
0
4
ENT
E
ENT
4
DL205 User Manual, 4th Edition, Rev. B
ANDF
K
bbb
DL260 Range
aaa
bbb
0–1777
–
0–1777
–
0–3777
–
0–1777
–
0–377
–
0–377
–
0–777
–
0-3777
–
-
1–32
Location
Constant
C13
C12
C11
C10
K4
ON
ON ON OFF
15 14 13 12 11 10 9
8
7 6 5
4 3
0
0
0
0 0
0
0
0
0 0
0
0
0
0 0
0
0
0
0 0
0
0
0
0 1
0
0 0
0
0
0
0 0
0
0
0
0 1
Location
Constant
C23
C22
C21
C20
ON
OFF
OFF
K4
1
A aaa
2
3
4
5
6
7
8
9
10
11
12
C10
13
2
1
0
14
1
1 1
0
1
1
0
A
1
0
0
0
0
0
0
B
C20
C
OFF
D
5–73
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?