262
Description When the execution condition is OFF, SUM(––) is not executed. When the
execution condition is ON, SUM(––) adds either the contents of words R1 to
R1+N1 or the bytes in words R1 to R1+N/21 and outputs that value to the des-
tination words (D and D+1). The data can be summed as binary or BCD and will
be output in the same form. Binary data can be either signed or unsigned.
The function of bits in C are shown in the following diagram and explained in
more detail below.
15 14 13 12 11 00
Number of items in range (N, BCD)
Number of words or number of bytes
001 to 999
Starting byte in R1 (when bit 13 is ON)
1 (ON): Rightmost
0 (OFF): Leftmost
Addition units
1 (ON): Bytes
0 (OFF): Words
C:
Data type
1 (ON): Binary
0 (OFF): BCD
Data type (when bit 14 is ON)
1 (ON): Signed binary
0 (OFF): Unsigned binary
Number of Items in Range The number of items within the range (N) is contained in the 3 rightmost digits of
C, which must be BCD between 001 and 999. This number will indicate the num-
ber of words or the number of bytes depending the items being summed.
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
R1. The leftmost byte of R1 will not be added if bit 12 is ON.
MSB LSB
R112
R1+1 3 4
R1+2 5 6
R1+3 7 8
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.
Refer to page 27 for details on signed binary data.
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.)
R1 and R1+N1 are not in the same data area.
The number of items in C is not BCD between 001 and 999.
The data being summed is not BCD when BCD was designated.
EQ: ON when the result is zero.
N: ON when bit 15 of D is set to 1.
Special Math Instructions Section 5-21