Chapter 5: Standard RLL Instructions - Table
Discrete Bit Flags
1
SP53
2
SP67
NOTE: Status flags are only valid until:
3
— the end of the scan
— or another instruction that uses the same flag is executed.
4
The example table to the right contains BCD data as
shown (for demonstration purposes). Suppose we want to
5
do a table shift right by 3 BCD digits (12 bits).
Converting to octal, 12 bits is 14 octal. Using the Table
Shift Right instruction and specifying a shift by octal 14,
6
we have the resulting table shown at the far right. Notice
that the 2–3–4 sequence has been discarded, and the
7
0–0–0 sequence has been shifted in at the bottom.
The following ladder example assumes the data at V3000 to V3004 already exists as shown
8
above. We will use input X0 to trigger the Table Shift Right operation. First, we will load the
table length (5 words) into the accumulator stack. Next, we load the starting address into the
accumulator. Since V3000 is an octal number we have to convert it to hex by using the LDA
9
command. Finally, we use the Table Shift Right instruction and specify the number of bits to
be shifted (12 decimal), which is 14 octal.
10
DirectSOFT
11
12
13
14
A
Handheld Programmer Keystrokes
$
B
SHFT
C
SHFT
D
SHFT
5–170
DL205 User Manual, 4th Edition, Rev. B
On when the number of bits to be shifted is larger than the total bits contained within the
table.
On when the last bit shifted (just before it is discarded) is a "1".
X0
LD
K5
LDA
O 3000
TSHFR
O 14
A
ENT
STR
0
L
D
ANDST
3
L
D
A
ANDST
3
0
T
S
SHFT
MLR
RST
Description
Load the constant value 5
(Hex.) into the lower 16 bits
of the accumulator.
Convert octal 3000 to HEX
and load the value into the
accumulator. This is the
table beginning.
Do a table shift right by 12
bits, which is 14 octal.
F
PREV
ENT
5
D
A
A
3
0
H
F
R
7
5
ORN
V 3000
1 2 3 4
5 6 7 8
1 1 2 2
3 3 4 4
5 5 6 6
A
ENT
0
0
B
E
NEXT
1
4
V 3000
6 7 8 1
1 2 2 5
3 4 4 1
5 6 6 3
0 0 0 5
ENT
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?