DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-165
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
The following description applies to both the Table Shift Left and Table Shift Right
instructions. A table is just a range of V-memory locations. The Table Shift Left and Table
Shift Right instructions shift bits serially throughout the entire table. Bits are shifted out the
end of one word and into the opposite end of an adjacent word. At the ends of the table, bits
are either discarded, or zeros are shifted into the table. The example tables below are arbitrarily
four words long.
Step 1: Load the length of the table (number of V-memory locations) into the first level of the
accumulator stack. This parameter must be a HEX value, 0 to FF.
Step 2: Load the starting V-memory location for the table into the accumulator. This
parameter must be a HEX value. You can use the LDA instruction to convert
an octal address to hex.
Step 3: Insert the Table Shift Left or Table shift Right instruction. This specifies the
number of bit positions you wish to shift the entire table. The number of bit
positions must be in octal.
Helpful hint
: — Remember that each V-memory location contains 16 bits. So, the bits of the
first word of the table are numbered from 0 to 17 octal. If you want to shift the entire table by
20 bits, that is 24 octal. SP 53 will be set if the number of bits to be shifted is larger than the
total bits contained within the table. Flag 67 will be set if the last bit shifted (just before it is
discarded) is a “1”.
A aaa
T S HF L
A aaa
TSHFR
Table Shift Left
Table Shift Right
Discard Bits
Shift in zeros
Discard Bits
V - xxxx + 2
V - xxxx + 1
V - xxxx
Shift in zeros
Operand Data Type
DL06 Range
A
aaa
V-memory
V
See memory map
DS
Used
HPP Used
DS
Used
HPP Used
Table Shift Left (TSHFL)
The Table Shift Left instruction shifts all the bits in a V-memory
table to the left, the specified number of bit positions.
Table Shift Right (TSHFR)
The Table Shift Right instruction shifts all the bits in a
V-memory table to the right, a specified number of bit positions.