Flagd: Carry (C); Addition, Subtraction, Multiplication, And Divison - HP -16C Owner's Handbook Manual

Table of Contents

Advertisement

Section 4: Arithmetic and Bit Manipulation Functions
41
Keystrokes
Display
([STATUS]: 2-16-0000)
[DEC) 32767 [ENTER]
32767 d
2 [x]
32766 d
G annunciator displayed
and flag 5 set; overflow.
Leading binary digit is
zero; numberis positive.
(9](cF]5
32766 d
Clears flag 5.
Flag 5 can also be set in the course of a running program; this will
not halt program execution.
Arithmetic Functions
Addition, Subtraction, Multiplication, and Division
The arithmetic operations [+], (-], [x], and (] can be performed
using integers in any of the four number bases. The operands,
which can be entered in different bases, must be in the Y- and
X-registers. After the operation is performed, the stack drops and
the result is placed in the X-register.
In Integer mode, [¢] performs an integer division. The fractional
part of the quotient is truncated.
All the arithmetic operators except [x] will set or clear flag 4 and
flag 5 whenever executed. [x] affects flag 5 only.
Example: Find (5A0,¢) + (177764y).
Keystrokes
Display
([STATUS]: 2-16-0000)
5A0
5A0 h
Enters first number.
177764
177764 o
Changes to Octal; keys
in second number.
(<]
177610 o
Resultin base 8. Since a
carry was not generated,
the result is exact.
HEX
FF88 h
Converts to base 16.
Addition and Subtraction in 1's Complement Mode. In 2's
Complement and Unsigned modes, the result of an addition or
subtraction is simply the sum or difference of the two bit patterns
in the X- and Y-registers. In 1's Complement mode, however, the

Advertisement

Table of Contents
loading

Table of Contents