For example, supppose we have a table starting at V3000
that is two words long, as shown to the right. Each word
in the table contains 16 bits, or 0 to 17 in octal. To set bit
12 in the second word, we use its octal reference (bit 14).
Then we compute the bit's octal address from the start of
the table, so 17 + 14 = 34 octal. The following program
shows how to set the bit as shown to a "1".
In this ladder example, we will use input X0 to trigger the Set Bit operation. First, we will
load the table length (2 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 Set Bit (or Reset Bit) instruction and specify the octal
address of the bit (bit 34), referenced from the table beginning.
DirectSOFT
Handheld Programmer Keystrokes
$
STR
SHFT
SHFT
X
SET
Chapter 5: Standard RLL Instructions - Table
X0
LD
K2
LDA
O 3000
SETBIT
O 34
A
ENT
0
L
D
PREV
ANDST
3
L
D
A
ANDST
3
0
B
I
T
SHFT
1
8
MLR
DL205 User Manual, 4th Edition, Rev. B
V3000
MSB
V3001
MSB
1
1
1
1
1
1
7
6
5
4
3
2
Load the constant value 2
(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.
Set bit 34 (octal) in the table
to a "1".
C
ENT
2
D
A
A
A
ENT
3
0
0
0
D
E
NEXT
ENT
3
4
LSB
16 bits
LSB
1
1
7 6 5 4 3 2 1
0
1
0
10
11
12
13
14
5–149
1
2
3
4
5
6
7
8
9
A
B
C
D
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?