Apple II User Manual

Page of 257
Exit: The two-byte signed two's complement representation of the integer
portion is left in M1 (high-order byte) and M1+1 (low-order byte).  The
floating point values +24.63 and -61.2 are converted to the integers +24
and -61 respectively.  FP1 and E are altered but FP2, E, SIGN, and SCR are
not.  The A- and X-REGs are altered but the Y-REG is not.
Example: The floating point value +274 is in FP1 prior to calling FIX.
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $88 |  | $44 |  | $80 |  |  0  |   (+274)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
After calling FIX, M1 (high-order byte) and M1+1 (low-order byte) contain
the integer representation of +274 ($0112).
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $8E |  | $01 |  | $12 |  |  0  |
     |_____|  |_____|  |_____|  |_____|
       X1       M1
Note: FP1 contains an unnormalized representation of +274 upon exit.
NORM Subroutine (address $F463)
Purpose: To normalize the value in FP1, thus insuring maximum precision.
Entry: A normalized or unnormalized value is in FP1.
Exit: The value in FP1 is normalized.  A zero mantissa will exit with X1=0
(2 exponent).  If the exponent on exit is -128 (X1=0) then the mantissa
(M1) is not necessarily normalized (with the two high-order mantissa bits
unequal).  E, FP2, SIGN, AND SCR are not distubed.  The A-REG is disturbed
but the X- and Y-REGs are not.  The carry is set.
Example: FP1 contains +12 in unnormalized form (as .0011 x 2 ).
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $86 |  | $0C |  |  0  |  |  0  |   (+12)
     |_____|  |_____|  |_____|  |_____|
       x1       M1
Upon exit from NORM, FP1 contains +12 in normalized form (as 1.1 x 2 ).
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $83 |  | $60 |  |  0  |  |  0  |   (+12)