DL205 User Manual, 4th Edition, Rev. B
5–170
Chapter 5: Standard RLL Instructions - Table
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
NOTE:
Status flags are only valid until:
— the end of the scan
— or another instruction that uses the same flag is executed.
The example table to the right contains BCD data as
shown (for demonstration purposes). Suppose we want to
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,
we have the resulting table shown at the far right. Notice
that the 2–3–4 sequence has been discarded, and the
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
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
command. Finally, we use the Table Shift Right instruction and specify the number of bits to
be shifted (12 decimal), which is 14 octal.
1
2
3
4
5
6
7
8
1 1
2 2
3 3
4 4
6
7
8
1
1
2 2
5
3
4 4
1
5
6 6
3
5 5
6 6
0 0 0
5
V
3
000
V
3
000
Discrete Bit Flags
Description
SP53
On when the number of bits to be shifted is larger than the total bits contained within the
table.
SP67
On when the last bit shifted (just before it is discarded) is a “1”.
Direct
SOFT
LD
K5
X0
Load the constant value 5
(Hex.) into the lower 16 bits
of the accumulator.
LDA
O 3000
TSHFR
O 14
Do a table shift right by 12
bits, which is 14 octal.
Convert octal 3000 to HEX
and load the value into the
accumulator. This is the
table beginning.
Handheld Programmer Keystrokes
STR
$
SHFT
ANDST
L
3
D
SHFT
MLR
T
RST
S
7
H
PREV
0
A
ENT
5
F
0
A
0
A
ENT
SHFT
ANDST
L
3
D
3
D
0
A
0
A
ENT
1
B
4
E
ENT
SHFT
5
F
ORN
R
NEXT