Omron C200HX Operation Manual page 268

Hide thumbs Also See for C200HX:
Table of Contents

Advertisement

Binary Calculations
Flags
Example 1: Normal Data
00000
+
Example 2:
Signed Binary Data
00000
250
ADBL(––) can also be used to add signed binary data. The overflow and under-
flow flags (SR 25404 and SR 25405) indicate whether the result has exceeded
the lower or upper limits of the 32-bit signed binary data range. Refer to page 27
for details on signed binary data.
Indirectly addressed DM word is non-existent. (Content of DM word is
ER:
not BCD, or the DM area boundary has been exceeded.)
CY:
ON when the result is greater than FFFF FFFF.
EQ:
ON when the result is 0.
OF:
ON when the result exceeds +2,147,483,647 (7FFF FFFF).
UF:
ON when the result is below –2,147,483,648 (8000 0000).
N:
ON when bit 15 of R is set to 1.
The following example shows an eight-digit addition with CY (SR 25504) used to
represent the status of the 9
14020187 + 00A3F8C5 = 14A5FA4C
Au : 000
Au + 1 : 001
1
4
0
2
0
Ad + 1 : DM 0021
Ad : DM 0020
F
0
0
A
3
R + 1 : LR 22
R : LR 21
1
4
A
5
F
Note The status of the UF and OF flags can be ignored since they are relevant only in
the addition of signed binary data.
In the following example, ADBL(––) is used to add two 32-bit signed binary val-
ues and output the 32-bit signed binary result to R and R+1. (The 2's comple-
ment is used to express negative values).
The effective range for 32-bit signed binary values is –2,147,483,648
(8000 0000) to +2,147,483,647 (7FFF FFFF). The overflow flag (OF: SR 25404)
is turned ON if the result exceeds +2,147,483,647 (7FFF FFFF) and the under-
flow flag (UF: SR 25405) is turned ON if the result falls below –2,147,483,648
(8000 0000).
th
digit.
Address Instruction
CLC(41)
00000
00001
ADBL(––)
00002
000
DM 0020
LR 21
1
8
7
8
C
5
0
CY (Cleared with CLC(41))
A
4
C
CY (No carry)
0
Address Instruction
CLC(41)
00000
00001
ADBL(––)
00002
LR 20
DM 0010
DM 0020
Section 5-20
Operands
LD
00000
CLC(41)
ADBL(––)
000
DM
0020
LR
Operands
LD
00000
CLC(41)
ADBL(––)
LR
DM
0010
DM
0020
21
20

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200hgC200he

Table of Contents