Apple II User Manual

Page of 257
FSUB subroutine (address $F468)
Purpose: To subtract two floating point numbers.
Entry: The minuend is in FP1 and the subtrahend is in FP2.  Both should be
normalized to retain maximum precision prior to calling FSUB.
Uses: FCOMPL, ALGNSWP, FADD, ADD, NORM, RTLOG.
Exit: The normalized difference is in FP1 with the mantissa truncated to 24
bits.  FP2 holds either the minued or the negated subtrahend, whichever is
of greater magnitude.  E is altered but SIGN and SCR are not.  the A-REG is
altered and the X-REG is cleared.  The Y-REG is not disturbed.
Cautions: An exit to location S3F5 is taken if the result is less than
-2^128 or greater than +2^128-1.  or if the subtrahend is -2^128.
Example: Prior to calling FSUB, FP1 contains +7 (minuend) and FP2 contalns
-5 (subtrahend).
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $82 |  | $70 |  |  0  |  |  0  |   (+12)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP2: | $82 |  | $B0 |  |  0  |  |  0  |   (- 5)
     |_____|  |_____|  |_____|  |_____|
       X2       M2
After calling FSUB, FP1 contains +12 and FP2 contains +7.
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $83 |  | $60 |  |  0  |  |  0  |   (+12)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
FMUL subroutine (address $F48C)
Purpose: To multiply floating point numbers.
Entry: The multiplicand and multiplier must reside in FP1 and FP2
respectively.  Both should be normalized prior to calling FMUL to retain
maximum precision.
Uses: MD1, MD2, RTLOG1, ADD, MDEND.
Exit: The signed normalized floating point product is left in FP1.  M1 is