The routine "A" (ADD) computes the sum of two fractions. The routine "B" (SUB) changes the sign of the second fraction
to compute the difference.
- Step 47: save second fraction in B.
- Step 48-52: recall first fraction, call UNPACK and store numerator in C and denominator in D.
- Step 53-54: recall second fraction, call UNPACK.
- Step 55-62: compute the numerator of the sum, and if negative set Flag 2.
- Step 63-70: compute the denominator, turn it into decimal part and, according to Flag 2, is added or substracted to the numerator.
- Step 71: simplify the result.
|
 |
The routine "C" (MUL) compute the product of two fractions. The routine "D" (DIV) set Flag 2 to mark the division.
- Step 76-77: clear the sign flags.
- Step 78: store second fraction in memory.
- Step 79-86: recall first fraction fraction, call UNPACK and if negative set Flag 0. Store numerator in C and denominator in D.
- Step 87-91: recall second fraction, call UNPACK and if negative set Flag 1.
- Step 92-93: if Flag 2 is set, reverse second fraction for division.
- Step 94-95: compute the numerator.
- Step 96-101: compute the denominator, turn it into decimal part and reassemble the fraction.
- Step 102-105: apply signs according to flags.
- Step 106: simplify the result.
|
 |