HP 9835A Programming Manual page 104

35 series desktop computer assembly development rom
Table of Contents

Advertisement

Arithmetic 87
Ten's complement helps to accomplish addition, too. Rather than go into all of the nuances and
subtleties of the arithmetic process, there is a simple rule for accomplishing decimal summa-
tions using ten's complements. Assuming the exponents are the same for the numbers to be
added -
• If
the signs of the numbers are the same, simply add them and leave the signs alone. If DC
occurs, the result (Ar2) must be shifted to the right one place, and the exponent adjusted .
• If the signs of the numbers are different, complement, then add. A further complementing
action may be necessary:
if
DC occurs, then the result necessarily has the same sign as
the number which was not complemeted;
if
DC does not occur, then the result must be
complemented and then given the sign of the number which was complemented.
The FXA instruction is used to add mantissas. Here is a routine to implement the rule -
::::;()Ui?CE
::::;UUF:C[
;····T"i(::·
.::: ... l.·····
::::;CiUF'C:E::)
i·i;
::::i(:)(,,:::-
':::;()\...\:;;:'CE Ji)::::.t
.'.:,(:;j::
'3UL!PC:C
L ...
ur"i
::::::1.
'!""iA
\:::!i .... ,
i=iDfi
:::::1
i:::"··'
:::1 •. : .•. ..::
t
i :
:r=
!
=:::' ::::.
;=
••••.•
:~~. ~.,.!
'j
+.
'j',
*;
j'-"
-:::t
-onificant
rii0 ,
;"'j ..1,) : .. ': ",:.
roo'
:;:::"-'i'"

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 9835A and is the answer not in the manual?

Table of Contents