2'S Complement - Neg(--) - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Conversion Instructions
Example
00000
5-19-17 2'S COMPLEMENT – NEG(––)
Limitations
Description
Flags
282
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
D and D+15 are not in the same data area.
EQ:
ON when the content of S is zero; otherwise OFF.
The following example shows how to use COLM(––) to move the contents of
word DM 0100 (00 to 15) to bit column 15 of the set (DM 0200 to DM 0215).
Ladder Symbols
NEG(––)
S
R
000
This instruction is available in the CQM1-CPU4@-E/-EV1 only.
DM 6144 to DM 6655 cannot be used for R.
Converts the four-digit hexadecimal content of the source word (S) to its 2's
complement and outputs the result to the result word (R). This operation is
effectively the same as subtracting S from 0000 and outputting the result to R;
it will calculate the absolute value of negative signed binary data.
If the content of S is 0000, the content of R will also be 0000 after execution
and EQ (SR 25506) will be turned on.
If the content of S is 8000, the content of R will also be 8000 after execution
and UF (SR 25405) will be turned on.
Note Refer to 1-10 Calculating with Signed Binary Data for more details.
Indirectly addressed DM word is non-existent. (Content of *DM word
ER:
is not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the content of R is zero after execution; otherwise OFF.
UF:
ON when the content of S is 8000; otherwise OFF.
Address Instruction
COLM(––)
00000
DM 0100
00001
DM 0200
#0015
@NEG(––)
S
R
000
Section 5-19
Operands
LD
00000
COLM(––)
DM
DM
#
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, SR, AR, DM, HR, LR
000
Not used. Set to 000.
0100
0200
0015

Advertisement

Table of Contents
loading

Table of Contents