The text of a manual · part 21 of 40
DL05 Micro PLC User Manual, Volume 1 of 2: Chapter 5: Standard RLL and Intelligent Box Instructions, pages 184 to 193
Pages 184 to 193 of 379, from DL05 Micro PLC User Manual, Volume 1 of 2
The original document is the PDF (5.8 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the AutomationDirect D0-05AA
Page 184
Chapter 5: Standard RLL - Logical Instructions
And Double (ANDD) DS5
Used
HPP
Used
1 2 3 Operand Data Type DL05 Range 4 aaa 5 6 Discrete Bit Flags Description 7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8 In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the Load Double instruction. The value in the accumulator is anded 9 with 36476A38 using the And double instruction. The value in the accumulator is output to V2010 and V2011 using the Out Double instruction. 10 11 12 13 14 A B C D The And Double is a 32 bit instruction that logically ands the value in the accumulator with two consecutive V-memory locations or an 8 digit (max.) constant value (Aaaa). The result resides in the accumulator. Discrete status flags indicate if the result of the And Double is zero or a negative number (the most significant bit is on).
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
SP63 SP70
See memory map See memory map 0–FFFFFFFF
On if the result in the accumulator is zero. On anytime the value in the accumulator is negative
DirectSOFT 5 Direct SOFT32 X1
ANDD K aaa
V2000
5
LDD
4
7
V2000
E
2
8
7
A
V2000
Load the value in V2000 and V2001 into the accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6 5
4 3
2
1
0
Acc.
0
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
Acc.
0
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
AND 36476A38
0
0
1
1
0
1
1
0
0
1
0
0
0
1
1
1
0
1
1
0
1
0
1
0
0
0
1
1
1
0
0
0
Acc.
0
0
0
1 0
0
1
0
0
0
1 0
0
0
0
1 0
1 0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
0
0
0
4
4
6
2
8
3
8
ANDD
K36476A38
AND the value in the accumulator with the constant value 36476A38
OUTD
V2010
1
V2011
Copy the value in the accumulator to V2010 and V2011
V2010
Handheld Programmer Keystrokes $
B
STR
1
L ANDST
D
V AND
SHFT
D
GX OUT
SHFT
D
SHFT
ENT
D
3 3 3
C
3
A
2
SHFT
D
C
A
B
2
0
A
0
K JMP
A
0
G
3
6
A 1
0
E
0
ENT
H
4
G
7
6
SHFT
A
0
SHFT
D
I
3
8
ENT
ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–61
Page 185
Chapter 5: Standard RLL - Logical Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Or (OR) DS5
Used
HPP
Used
The Or instruction is a 16 bit instruction that logically ors the value in the lower 16 bits of the accumulator with a specified Vmemory location (Aaaa). The result resides in the accumulator. The discrete status flag indicates if the result of the Or is zero. Operand Data Type
A aaa
DL05 Range aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map See memory map
Discrete Bit Flags SP63 SP70
OR
Description On if the result in the accumulator is zero. On anytime the value in the accumulator is negative.
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator using the Load instruction. The value in the accumulator is ored with V2006 using the Or instruction. The value in the lower 16 bits of the accumulator are output to V2010 using the Out instruction.
DirectSOFT Direct SOFT32 5
5–62
X1
V2000
LD 2
8
7
A
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6 5
4 3
2
1
0
Acc.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
V2006
Acc.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
Or the value in the accumulator with the value in V2006
6A38 OR (V2006)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
1
0
0
0
1
1
1
0
0
0
Acc.
0
0
0
0
0
0 1
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
1
0
0
1
1
1
1
0
1
0
6
A
7
A
V2000 The upper 16 bits of the accumulator will be set to 0
Load the value in V2000 into the lower 16 bits of the accumulator
OR
OUT V2010 Copy the value in the lower 16 bits of the accumulator to V2010 Handheld Programmer Keystrokes $
B STR
SHFT Q OR GX OUT
1 L ANDST
V2010
ENT
D
C 3
A 2
SHFT
V AND
C
SHFT
V AND
C
A 0
A 2
0 A
2
A 0
A 0 B 0
0 G 6 A
1
0
ENT ENT ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 186
Chapter 5: Standard RLL - Logical Instructions
Or Double (ORD) DS5
Used
HPP
Used
1 2 3 Operand Data Type DL05 Range 4 aaa 5 6 Discrete Bit Flags Description 7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8 In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the Load Double instruction. The value in the accumulator is ored 9 with 36476A38 using the Or Double instruction. The value in the accumulator is output to V2010 and V2011 using the Out Double instruction. 10 11 12 13 14 A B C D The Or Double is a 32 bit instruction that ors the value in the accumulator with the value (Aaaa), which is either two consecutive V-memory locations or an 8 digit (max.) constant value. The result resides in the accumulator. Discrete status flags indicate if the result of the Or Double is zero or a negative number (the most significant bit is on).
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
SP63 SP70
ORD
K aaa
See memory map See memory map 0–FFFFFFFF
On if the result in the accumulator is zero. On anytime the value in the accumulator is negative.
DirectSOFT 5 Direct SOFT32 X1
V2000
V2001
LDD
5
2
8
7
A
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6 5
4 3
2
1
0
0
0
0
1
1
0
1
0
V2000
4
7
E
Load the value in V2000 and V2001 into accumulator
Acc.
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
1
1
ORD
K36476A38
OR the value in the accumulator with the constant value 36476A38
Acc.
0
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
OR 36476A38
0
0
1
1
0
1
1
0
0
1
0
0
0
1
1
1
0
1
1
0
1
0
1
0
0
0
1
1
1
0
0
0
Acc.
0
1 0
1 0
1 0
0
1
1 0
0
0
0 1
0 1
0 1
0 1
0 1
1 0
1 0
0
1
1
0
1
0
1
0
0
1
1
1
1
0
1
0
6
7
F
6
A
7
A
OUTD
V2010
7
Copy the value in the accumulator to V2010 and V2011
V2011
V2010
Handheld Programmer Keystrokes $
B
STR
SHFT
Q
OR
GX OUT
1
L ANDST
D
SHFT
D
SHFT
D
ENT
D
3 3 3
C
3
A
2
SHFT
D
C
A
B
2
0
A
0
K JMP
A
0
G
3
6
A 1
0
E
0
ENT
H
4
G
7
6
SHFT
A
0
SHFT
D
I
3
8
ENT
ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–63
Page 187
Chapter 5: Standard RLL - Logical Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Exclusive Or (XOR) DS5
Used
HPP
Used
5–64
The Exclusive Or instruction is a 16 bit instruction that performs an exclusive or of the value in the lower 16 bits of the accumulator and a specified V-memory location (Aaaa). The result resides in the in the accumulator. The discrete status flag indicates if the result of the XOR is zero.
XOR A aaa
Operand Data Type
DL05 Range aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map See memory map
Discrete Bit Flags
Description
SP63 SP70
On if the result in the accumulator is zero. On anytime the value in the accumulator is negative.
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator using the Load instruction. The value in the accumulator is exclusive ored with V2006 using the Exclusive Or instruction. The value in the lower 16 bits of the accumulator are output to V2010 using the Out instruction.
DirectSOFT Direct SOFT32 5 X1
V2000
LD V2000 Load the value in V2000 into the lower 16 bits of the accumulator
2
8
7
A
The upper 16 bits of the accumulator will be set to 0 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6 5
4 3
2
1
0
Acc.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
Acc.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
XOR V2006 XOR the value in the accumulator with the value in V2006
6A38 XOR (V2006)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
1
0
0
0
1
1
1
0
0
0
Acc.
0
0
0
0
0
0 1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
1
0
0
0
0
1
0
4
2
4
2
OUT V2010 Copy the lower 16 bits of the accumulator to V2010
V2010
Handheld Programmer Keystrokes $
SHFT
STR SHFT
L ANDST
SHFT
X
GX OUT
SET
X
B SET
D
1 SHFT
3 SHFT
Q
SHFT
V AND
OR C 2
ENT V AND
C
SHFT
V AND
C
A
B
A
0
A 2
1
A 0
A 0
A 2 0
0 A
0
ENT G
0
6
ENT
ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
Page 188
Chapter 5: Standard RLL - Logical Instructions
Exclusive Or Double (XORD) DS5
Used
HPP
Used
1 2 3 4 Operand Data Type DL05 Range aaa 5 6 Discrete Bit Flags Description 7 8 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into 9 the accumulator using the Load Double instruction. The value in the accumulator is exclusively ored with 36476A38 using the Exclusive Or Double instruction. The value in the 10 accumulator is output to V2010 and V2011 using the Out Double instruction. 11 12 13 14 A B C D The Exclusive OR Double is a 32 bit instruction that performs an exclusive or of the value in the accumulator and the value (Aaaa), which is either two consecutive V-memory locations or an 8 digit (max.) constant. The result resides in the accumulator. Discrete status flags indicate if the result of the Exclusive Or Double is zero or a negative number (the most significant bit is on).
XORD K aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
SP63 SP70
DirectSOFT 5 Direct SOFT32 X1
See memory map See memory map 0–FFFFFFFF
On if the result in the accumulator is zero. On anytime the value in the accumulator is negative.
V2001
5
LDD
4
7
V2000
E
2
8
7
A
V2000
Load the value in V2000 and V2001 into the accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6 5
4 3
2
1
0
Acc.
0
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
Acc.
0
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
XORD 36476A38
0
0
1
1
0
1
1
0
0
1
0
0
0
1
1
1
0
1
1
0
1
0
1
0
0
0
1
1
1
0
0
0
Acc.
0
0 1
0 1
0
0
1 0
0 1
0
0
0
0 1
0 1
1 0
0
0
1 0
0
1
0
0
0
0
1
0
0
1
0
0
0
0
1
0
2
3
9
4
2
4
2
XORD
K36476A38
XORD the value in the accumulator with the constant value 36476A38 OUTD
V2010
Copy the value in the accumulator to V2010 and V2011
6
V2011
Handheld Programmer Keystrokes $
B
STR
1
SHFT
L ANDST
D
SHFT
X
Q
D
G
OR
E
3
6
GX OUT
SHFT
ENT
D
3
SET
4
D
C
3
A
2
SHFT
D
H
G
7
6
2
A
A
0
0
SHFT
K JMP
SHFT
A
SHFT
D
A
B
A
ENT
3
C
3
V2010
0
0
1
0
ENT
0
I
3
8
ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–65
Page 189
Chapter 5: Standard RLL - Logical Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Compare (CMP) DS5
Used
HPP
Used
The compare instruction is a 16 bit instruction that compares the value in the lower 16 bits of the accumulator with the value in a specified V-memory location (Aaaa). The corresponding status flag will be turned on indicating the result of the comparison. Operand Data Type
A aaa
DL05 Range aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map See memory map
Discrete Bit Flags
Description
SP60 SP61 SP62
On when the value in the accumulator is less than the instruction value. On when the value in the accumulator is equal to the instruction value. On when the value in the accumulator is greater than the instruction value.
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
In the following example when X1 is on, the constant 4526 will be loaded into the lower 16 bits of the accumulator using the Load instruction. The value in the accumulator is compared with the value in V2000 using the Compare instruction. The corresponding discrete status flag will be turned on indicating the result of the comparison. In this example, if the value in the accumulator is less than the value specified in the Compare instruction, SP60 will turn on energizing C30. DirectSOFT Direct SOFT32 5 X1
CONSTANT
LD 4
K4526
Acc. 0
0
0
0
V2000
SP60
8
C30
Handheld Programmer Keystrokes 1
ENT
SHFT
L ANDST
D
SHFT
C
SHFT
M ORST
P
SHFT
SP STRN
G
SHFT
C
D
$
STR
2
SHFT
3
2
K JMP
6 3
E C
CV A A
0 0
9
4
V2000
OUT
B
? 6
Compared with
Compare the value in the accumulator with the value in V2000
STR
? 2
44 55 2? 2 66 ?
CMP
$
5
The unused accumulator bits are set to zero
Load the constant value 4526 into the lower 16 bits of the accumulator
GX OUT
5–66
CMP
4 2
F A
5 0
ENT ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
C A
2 0
G A
6 0
ENT ENT
5
Page 190
Chapter 5: Standard RLL - Logical Instructions
Compare Double (CMPD) DS5
Used
HPP
Used
1 2 3 Operand Data Type DL05 Range aaa 4 5 Discrete Bit Flags Description 6 7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8 In the following example when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the Load Double instruction. The value in the accumulator is 9 compared with the value in V2010 and V2011 using the CMPD instruction. The corresponding discrete status flag will be turned on indicating the result of the comparison. In 10 this example, if the value in the accumulator is less than the value specified in the Compare instruction, SP60 will turn on energizing C30. 11 12 13 14 A B C D The Compare Double instruction is a 32–bit instruction that compares the value in the accumulator with the value (Aaaa), which is either two consecutive V-memory locations or an 8–digit (max.) constant. The corresponding status flag will be turned on indicating the result of the comparison.
CMPD A aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
SP60 SP61 SP62
See memory map See memory map 0–FFFFFFFF
On when the value in the accumulator is less than the instruction value. On when the value in the accumulator is equal to the instruction value. On when the value in the accumulator is greater than the instruction value.
DirectSOFT Direct SOFT32 5 X1
V2001
LDD
V2000
4
5
2
6
7
2
9
9
Acc. 4
5
? 2
6
77 72
9
9
2
6
V2000
Load the value in V2000 and V2001 into the accumulator
Compared with
CMPD
V2010
6
Compare the value in the accumulator with the value in V2010 and V2011
SP60
7
3
9
5
V2011
0
V2010
C30
OUT
Handheld Programmer Keystrokes $
B
STR
1
ENT
SHFT
L ANDST
D
SHFT
C
SHFT
M ORST
P
SHFT
SP STRN
G
SHFT
C
D
$
STR
GX OUT
2
3
D
C
3
2
CV 6 3
D A A
2
A
0
C
3
0 0
A
0
2
A
A
0
0
ENT
B
1
A
0
ENT
ENT ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–67
Page 191
Chapter 5: Standard RLL - Math Instructions
1 Math Instructions Add (ADD) 2 Add is a 16 bit instruction that adds a BCD value in the accumulator with a BCD value in a V-memory location (Aaaa). The result resides in the accumulator. 3 Operand Data Type DL05 Range 4 aaa 5 Discrete Bit Flags Description 6 7 8 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 9 In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator using the Load instruction. The value in the lower 16 bits of the accumulator are 10 added to the value in V2006 using the Add instruction. The value in the accumulator is copied to V2010 using the Out instruction. 11 12 13 14 A B C D ADD
DS5
Used
HPP
Used
A aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
SP63 SP66 SP67 SP70 SP75
See memory map See memory map
On when the result of the instruction causes the value in the accumulator to be zero. On when the 16 bit addition instruction results in a carry. On when the 32 bit addition instruction results in a carry. On anytime the value in the accumulator is negative. On when a BCD instruction is executed and a NON–BCD number was encountered.
DirectSOFT Direct SOFT32
V2000
X1
4
LD
9
3
5
V2000
Load the value in V2000 into the lower 16 bits of the accumulator
The unused accumulator bits are set to zero 0 0 0 0 4
ADD
+
V2006
Acc.
Add the value in the lower 16 bits of the accumulator with the value in V2006
9
3
5
(Accumulator)
2
5
0
0
(V2006)
7
4
3
5
7
4
3
5
OUT
V2010
Copy the value in the lower 16 bits of the accumulator to V2010 Handheld Programmer Keystrokes $
B
STR
SHFT
D
SHFT
A
D
GX OUT
5–68
1
L ANDST 0
V2010
ENT
A
C
2
3
D
A
0
C
3
3
SHFT
V AND
A
2
C
A 2
A
0 0
B 0
0
A
0
A 1
ENT
G
0
DL05 Micro PLC User Manual, 6th Edition, Rev. A
6
ENT
ENT
Page 192
Chapter 5: Standard RLL - Math Instructions
Add Double (ADDD) DS5
Used
HPP
Used
1 2 3 Operand Data Type DL05 Range aaa 4 5 Discrete Bit Flags Description 6 7 8 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 9 In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the Load Double instruction. The value in the accumulator is added 10 with the value in V2006 and V2007 using the Add Double instruction. The value in the accumulator is copied to V2010 and V2011 using the Out Double instruction. 11 12 13 14 A B C D Add Double is a 32 bit instruction that adds the BCD value in the accumulator with a BCD value (Aaaa), which is either two consecutive V-memory locations or an 8–digit (max.) BCD constant. The result resides in the accumulator.
ADDD A aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
SP63 SP66 SP67 SP70 SP75
Direct SOFT X1
See memory map See memory map 0–99999999
On when the result of the instruction causes the value in the accumulator to be zero. On when the 16 bit addition instruction results in a carry. On when the 32 bit addition instruction results in a carry. On anytime the value in the accumulator is negative. On when a BCD instruction is executed and a NON–BCD number was encountered.
V2001
6
LDD
7
V2000
3
9
5
0
2
6
V2000
Load the value in V2000 and V2001 into the accumulator ADDD
V2006
6
7
3
9
5
0
2
6
+ 2
0
0
0
4
0
4
6
Acc. 8
7
3
9
9
0
7
2
8
7
3
9
9
0
7
2
(Accumulator)
(V2006 and V2007)
Add the value in the accumulator with the value in V2006 and V2007 OUTD
V2010
V2011
Copy the value in the accumulator to V2010 and V2011
V2010
Handheld Programmer Keystrokes $
B
STR
1
SHFT
L ANDST
D
SHFT
A
D
GX OUT
D
D
3
D 3
A
C
3
3
0
SHFT
ENT
2
D
3
A
0
C
3
SHFT
A
2
V AND
A
0
C
A
0
A 2
0
G
6
0
B 0
ENT
A 1
0
ENT ENT
DL05 Micro PLC User Manual, 6th Edition, Rev. A
5–69
Page 193
Chapter 5: Standard RLL - Math Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Subtract (SUB) DS5
Used
HPP
Used
Operand Data Type
A aaa
DL05 Range aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map See memory map
Discrete Bit Flags
Description
SP63 SP64 SP65 SP70 SP75
On when the result of the instruction causes the value in the accumulator to be zero. On when the 16 bit addition instruction results in a borrow On when the 32 bit addition instruction results in a borrow On anytime the value in the accumulator is negative. On when a BCD instruction is executed and a NON–BCD number was encountered.
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator using the Load instruction. The value in V2006 is subtracted from the value in the accumulator using the Subtract instruction. The value in the accumulator is copied to V2010 using the Out instruction.
DirectSOFT Direct SOFT32
V2000
X1
2
4
7
The unused accumulator bits are set to zero 0 0
0
0
5
LD V2000 Load the value in V2000 into the lower 16 bits of the accumulator
_
SUB
2
4
7
5
(Accumulator)
1
5
9
2
(V2006)
V2006 Acc.
0
8
8
3
0
8
8
3
Subtract the value in V2006 from the value in the lower 16 bits of the accumulator OUT V2010 V2010 Copy the value in the lower 16 bits of the accumulator to V2010 Handheld Programmer Keystrokes $
B STR
1
SHFT
L ANDST
D
SHFT
S RST
U
GX OUT
5–70
SUB
Subtract is a 16 bit instruction that subtracts the BCD value (Aaaa) in a V-memory location from the BCD value in the lower 16 bits of the accumulator. The result resides in the accumulator.
ENT C
3
A 2
B ISG
1
SHFT
V AND
C 2
A
A
0
0
SHFT
V AND
C
A
B
A
0
1
ENT
0
A 2 0
DL05 Micro PLC User Manual, 6th Edition, Rev. A
A 0
ENT
G 0
6
ENT