7-24
Section
Logic Instructions
479
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.
@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
7-24 Logic Instructions
7-24-1 COMPLEMENT – COM(29)
Wd
: Complement word
IR, SR, AR, DM, HR, LR
Ladder Symbols
Operand Data Areas
COM(29)
Wd
@COM(29)
Wd
Limitations
DM 6144 to DM 6655 cannot be used for Wd.
When the execution condition is OFF, COM(29) is not executed. When the
execution condition is ON, COM(29) clears all ON bits and sets all OFF bits in
Wd.
Description