312
Special Math Instructions Section 5-22
Addition Units Words will be added if bit 13 is OFF and bytes will be added if bit 13 is ON.
If bytes are specified, the range can begin with the leftmost or rightmost byte
of R
1
. The leftmost byte of R
1
will not be added if bit 12 is ON.
The bytes will be added in this order when bit 12 is OFF: 1+2+3+4....
The bytes will be added in this order when bit 12 is ON: 2+3+4....
Data Type Data within the range is treated as unsigned binary when bit 14 of C is ON
and bit 15 is OFF, and it is treated as signed binary when both bits 14 and 15
are ON.
Data within the range is treated as BCD when bit 14 of C is OFF, regardless of
the status of bit 15.
Flags ER: Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
R
1
and R
1
+N–1 are not in the same data area.
The number of items in C is not BCD between 001 and 999.
The data being summed in not BCD when BCD was designated.
EQ: ON when the result is zero.
Example In the following example, the BCD contents of the 8 words from DM 0000 to
DM 0007 are added when IR 00001 is ON and the result is written to DM
0010 and DM 0011.
MSB LSB
R
1
12
R
1
+1 3 4
R
1
+2 5 6
R
1
+3 7 8
@SUM(––)
DM 0000
#0008
00001
DM 0010
Address Instruction Operands
00000 LD 00001
00001 @SUM(––)
# 0008
DM 0000
DM 0010
DM 0000 0001
DM 0001 0002
DM 0002 0003
DM 0003 0004
DM 0004 0005
DM 0005 0006
DM 0006 0007
DM 0007 0008
DM 0010 0036
DM 0011 0000