DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-62
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
The LDSX instruction uses the value in the first level of the accumulator stack as an offset to
determine which numerical or ASCII constant within the Data Label Area will be loaded into
the accumulator. The LDSX instruction interprets the value in the first level of the accumulator
stack as a HEX value.
Helpful Hint:
— The Load Address instruction can be used to convert octal to HEX and load
the value into the accumulator.
NOTE: Two consecutive Load instructions will place the value of the first load instruction onto the
accumulator stack.
In the following example when X1 is on, the offset of 1 is loaded into the accumulator. This
value will be placed into the first level of the accumulator stack when the LDSX instruction
is executed. The LDSX instruction specifies the Data Label (DLBL K2) where the numerical
constant(s) are located in the program and loads the constant value, indicated by the offset in
the stack, into the lower 16 bits of the accumulator.
LDSX
K aaa
Operand Data Type
DL06 Range
aaa
Constant
K
1-FFFF
LD
K1
X1
Load the offset value of 1 (K1) into the lower 16
bits of the accumulator.
LDSX
K2
Move the offset to the stack.
Load the accumulator with the data label
number
END
K2
NCON
K3333
NCON
K2323
NCON
K4549
Acc.
0
0
0
0
0
0
0
1
Hexadecimal
0
0
0
1
The unused accumulator
bits are set to zero
Value in 1st. level of stack is
used as offset. The value is 1
Offset 0
Offset 1
Offset 2
V2000
Acc.
2
3
2
3
0
0
0
0
2
3
2
3
0
0
0
0
0
0
0
1
Level 1
X
X
X
X
X
X
X
X
Level 2
X
X
X
X
X
X
X
X
Level 3
X
X
X
X
X
X
X
X
Level 4
X
X
X
X
X
X
X
X
Level 5
X
X
X
X
X
X
X
X
Level 6
X
X
X
X
X
X
X
X
Level 7
X
X
X
X
X
X
X
X
Level 8
Accumulator Stack
Acc.
0
0
0
0
0
0
0
2
K
Constant
0
0
0
2
The unused accumulator
bits are set to zero
The unused accumulator
bits are set to zero
Copy the value in the lower
16 bits of the accumulator
to V2000
OUT
V2000
DLBL
DLBL
Discrete Bit Flags
Description
SP53
On when the pointer is outside of the available range.
SP70
On anytime the value in the accumulator is negative.
SP76
On when any instruction loads a value of zero into the accumulator.
DS
Used
HPP Used
Load Accumulator Indexed from Data Constants (LDSX)
The Load Accumulator Indexed from Data Constants is a 16-bit
instruction. The instruction specifies a Data Label Area (DLBL)
where numerical or ASCII constants are stored. This value will be
loaded into the lower 16 bits.