Binary Calculation Instructions; Binary Add - Adb(50) - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Binary Calculation Instructions

Example
00000
DM 0001
6
3
2
5
0
63,250,561 = 7953.0221
7
9

5-21 Binary Calculation Instructions

5-21-1 BINARY ADD – ADB(50)
Limitations
Description
Flags
296
The following example shows how to take the square root of an eight digit
number. The result is a four-digit number, with the remainder rounded off. and
then round the result.
In this example, 63250561 = 7953.0221..., which is rounded off to 7953.
@ROOT(72)
DM 0000
001
DM 0000
5
6
1
(The remainder is rounded off.)
001
5
3
Ladder Symbols
ADB(50)
Au
Ad
R
DM 6144 to DM 6655 cannot be used for R.
When the execution condition is OFF, ADB(50) is not executed. When the exe-
cution condition is ON, ADB(50) adds the contents of Au, Ad, and CY, and
places the result in R. CY will be set if the result is greater than FFFF.
Au + Ad + CY
ADB(50) can also be used to add signed binary data. With the CQM1-
CPU4@-EV1, CPM1A, and SRM1, the underflow and overflow flags (SR
25404 and SR 25405) indicate whether the result has exceeded the lower or
upper limits of the 16-bit signed binary data range.
Indirectly addressed DM word is non-existent. (Content of *DM word
ER:
is not BCD, or the DM area boundary has been exceeded.)
CY:
ON when the result is greater than FFFF.
EQ:
ON when the result is 0.
OF:
ON when the result exceeds +32,767 (7FFF).
(CQM1-CPU4@-E/-EV1 only)
Address Instruction
00000
LD
00001
@ROOT(72)
@ADB(50)
Au
Ad
R
CY
Section 5-21
Operands
00000
DM
0000
001
Operand Data Areas
Au: Augend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Ad: Addend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, SR, AR, DM, HR, LR
R

Advertisement

Table of Contents
loading

Table of Contents