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 :::1 : .•. ..:: t i: :r= L ... ur"i ::::::1. ! =:::' ::::. ;= :~~. ~.,.! 'j +. 'j', *; j'-" -:::t '!""iA \:::!i .... , ;"'j ..1,) : .. ': ",:. roo' :;:::"-'i'" -onificant rii0 , i=iDfi :::::1 i:::"··'