59
Calculating with Signed Binary Data
Section 1-7
The following table shows equivalents between decimal and hexadecimal
data.
1-7-2
Arithmetic Flags
The results of executing signed binary instructions is reflected in the arith-
metic flags. The flags and the conditions under which it will turn ON are given
in the following table. The flags will be OFF when these conditions are not
met.
1-7-3
Inputting Signed Binary Data Using Decimal Values
Although calculations for signed binary data use hexadecimal expressions,
inputs from the Programming Console or CX-Programmer can be done using
decimal inputs and mnemonics for the instructions. The procedure for using
the Programming Console to input using decimal values is shown in the
Decimal
16-bit Hex
32-bit Hex
2,147,483,647
2,147,483,646
.
.
.
32,768
32,767
32,766
.
.
.
2
1
0
–1
–2
.
.
.
–32,767
–32,768
–32,769
.
.
.
–2,147,483,647
–2,147,483,648
–––
–––
.
.
.
–––
7FFF
7FFE
.
.
.
0002
0001
0000
FFFF
FFFE
.
.
.
8001
8000
–––
.
.
.
–––
–––
7FFF FFFF
7FFF FFFE
.
.
.
0000 8000
0000 7FFF
0000 7FFE
.
.
.
0000 0002
0000 0001
0000 0000
FFFF FFFF
FFFF FFFE
.
.
.
FFFF 8001
FFFF 8000
FFFF 7FFF
.
.
.
8000 0001
8000 0000
Flag
ON conditions
Carry Flag (SR 25504)
Carry in an addition.
Negative results for subtraction.
Equals Flag (SR 25506)
The results of addition, subtraction, multiplica-
tion, or division is 0.
Results of converting 2’s complement is 0.
Overflow Flag (SR 25404)
32,767 (7FFF) was exceeded in results of 16-bit
addition or subtraction.
2,147,483,647 (7FFF FFFF) was exceeded in
results of 32-bit addition or subtraction.
Underflow Flag (SR 25405)
–32,768 (8000) was exceeded in results of 16-bit
addition or subtraction, or conversion of 2’s com-
plement.
–2,147,483,648 (8000 0000) was exceeded in
results of 32-bit addition or subtraction, or con-
version of 2’s complement.