DL205 User Manual, 4th Edition, Rev. D
5-103
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Subtract Binary (SUBB)
The Subtract Binary instruction subtracts a 16-bit number (Aaaa)
from the value stored in the accumulator. The number in the
accumulator can be up to 32 bits long. The source of the 16-bit
operand can be a constant or a data value located in V-memory. Subtract Binary performs the
subtraction operation on the full binary representation of the operands, which distinguishes
it from the Subtract instruction (see page 5-91), which treats the operands as BCD numbers.
Although the subtraction operation is performed on the underlying binary values, the native
display format is hexadecimal. For that reason, you will need to load constants in hex.
The difference (result) of the Subtract Binary operation occupies the full 32 bits of the
accumulator and requires an Out Double to move the value to V-memory. If the value in the
accumulator occupies fewer than 32 bits, leading zeros are loaded in the left-most empty bit
positions of the accumulator.
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 will be loaded into the accumulator
using the Load instruction. The binary value in V1420 is subtracted from the binary value in
the accumulator using the Subtract Binary instruction. The value in the accumulator is copied
to V1500 - V1501 using the Out Double instruction.
230
240
250-1
260
SUBB
A aaa
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero
SP64 On when the 16-bit subtraction instruction results in a borrow
SP65 On when the 32-bit subtraction instruction results in a borrow
SP70 On anytime the value in the accumulator is negative
HandheldProgr ammerKeystrokes
LD
V1400
X1
SUBB
V1420
Thebinaryval ue in V1420 is
subtracted from thevalue in
theaccumulator
OUT
V1500
Copy thevalue in thelower 16
bits of theaccumulatortoV1500
V1500
(V1420) A0B (Hex) = 2571 (decimal)
0
1(Accumulator) 1024 (Hex) = 4132 (decimal)
0
1
0
0
V1400
024
61 9
000 02 4
A0 B
Acc.
619
The unused accumulator
bits areset to zero
STR1
D1 40 0
OUT 1500
14 0
S
2
SHFT B
SHFT
ENT
SHFT
LENT
UB
ENT
ENT
SHFT
Use either OR Constant
V-memory
LD
BIN
K1024
Load the value in V1400
into the lower 16 bits of
the accumulator
-
DirectSOFT
(Accumulator) 619 (Hex) = 1561 (decimal)
Operand Data Type DL250-1 Range DL260 Range
A aaa aaa
V-memory V All (See page 3-55) All (See page 3-56)
Pointer P All V-mem (See page 3-55) All V-mem (See page 3-56)
Constant K 0-FFFF 0-FFFF
DS Used
HPP Used