Apple II User Manual

Page of 257
altered.  The A- and X-REGs are altered and the Y-REG is cleared.
Uses: MD1, MD2, MDEND.
Cautions: An exit to location $3F5 is taken if the quotient is less than
-2^128 or greater than +2^128-1
Notes: MD2 contains the remainder mantissa (equivalent to the MOD
function).  The remainder exponent is the same as the quotient exponent, or
1 less if the dividend mantissa magnitude is less than the divisor mantissa
magnitude.
Example: Prior to calling FDIV, FP1 contains -60 (dividend), and FP2
contains +12 (divisor).
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $85 |  | $80 |  |  0  |  |  0  |   (-60)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP2  | $83 |  | $60 |  |  0  |  |  0  |   (+12)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
After calling FMUL, FP1 contains -5 and M2 contains 0.
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $82 |  | $B0 |  |  0  |  |  0  |   (-5)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
FLOAT Subroutine (address $F451)
Purpose: To convert integers to floating point representation.
Entry: A signed (two's complement) 2-byte integer is stored in M1
(high-order byte) and M1+1 (low-order byte).  M1+2 must be cleared by user
prior to entry.
Uses: NORM1.
Exit: The normalized floating point equivalent is left in FP1.  E, FP2,
SIGN, and SCR are not disturbed.  The A-REG contains a copy of the
high-order mantissa byte upon exit but the X- and Y-REGs are not disturbed.
The carry is cleared.
Notes: To float a 1-byte integer, place it in M1+1 and clear M1 as well as