Automationdirect.com DirectLOGIC DL205 Series User Manual page 327

Table of Contents

Advertisement

Chapter 5: Standard RLL Instructions - Math
Subtract Formatted (SUBF)
1
Subtract Formatted is a 32-bit instruction that subtracts the
230
BCD value (Aaaa), which is a range of discrete bits, from the
240
BCD value in the accumulator. The specified range (Kbbb)
2
250-1
can be 1 to 32 consecutive bits. The result resides in the
accumulator.
260
3
DS
Used
4
HPP Used
Inputs
Outputs
5
Control Relays
Stage Bits
Timer Bits
6
Counter Bits
Special Relays
7
Global I/O
Constant
8
Discrete Bit Flags
SP63
9
SP64
SP65
SP70
10
SP75
NOTE: Status flags are valid only until another instruction uses the same flag.
11
In the following example, when X6 is on, the value formed by discrete locations X0–X3 is
12
loaded into the accumulator using the Load Formatted instruction. The value formed by
discrete location C0–C3 is subtracted from the value in the accumulator using the Subtract
Formatted instruction. The value in the lower four bits of the accumulator is copied to
13
Y10–Y13 using the Out Formatted instruction.
DirectSOFT
14
A
B
Handheld Programmer Keystrokes
C
$
STR
SHFT
D
SHFT
GX
OUT
5–110
DL205 User Manual, 4th Edition, Rev. B
Operand Data Type
A
X
Y
C
S
T
CT
SP
GX/GY
K
On when the result of the instruction causes the value in the accumulator to be zero.
On when the 16-bit subtraction instruction results in a borrow.
On when the 32-bit subtraction 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.
Load the BCD value represented
X6
LDF
X0
by discrete locations X0-X3 into
K4
the accumulator
Subtract the BCD value
SUBF
C0
represented by C0-C3 from
K4
the value in the accumulator
Copy the lower 4 bits of the
OUTF
Y10
accumulator to discrete
K4
locations Y10- - Y13
G
ENT
6
L
D
F
A
ANDST
3
5
0
S
U
B
F
SHFT
ISG
1
5
RST
F
B
A
SHFT
5
1
0
DL260 Range
aaa
0-1777
0-1777
0-3777
0-1777
0-377
0-377
0-777
0-3777
-
Description
The unused accumulator
bits are set to zero
0
0
0
0
_
ACC.
0
0
0
0
E
ENT
4
A
NEXT
NEXT
NEXT
NEXT
0
E
ENT
4
SUBF
K bbb
bbb
-
-
-
-
-
-
-
-
1-32
X3
X2
X1
X0
ON
OFF
OFF
ON
(Accumulator)
0
0
0
9
C3
C2
ON
OFF
8
(C0- - C3)
0
0
0
1
Y13
Y12
Y11
Y10
OFF
OFF
OFF
ON
E
ENT
4
A aaa
C1
C0
OFF
OFF

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Table of Contents

Save PDF