Apple ii Battery Charger User Manual


 
MD2 subroutine (address $F4E2)
Purpose: To clear the 3-byte MANT1 field for FMUL and FDIV, check for
inital result exponent overflow (and underflow), and initialize the X-REG
to $17 for loop counting.
Entry: the X-REG is cleared by the user since it is placed in the 3 bytes
of MANT1. The A-REG contains the result of an exponent addition (FMUL) or
subtraction (FDIV). The carry and sign status bits should be set according
to this addition or subtraction for overflow and underflow determination.
Exit: The 3 bytes of M1 are cleared (or all set to the contents of the
X-REG on Entry) and the Y-REG is loaded with $17. The sign bit of the
A-REG is complemented and a copy of the A-REG is stored in X1. FP2, SIGN,
SCR, and the X-REG are not disturbed.
Uses: NORM.
Caution: Exponent overflow results in an exit to location $3F5. Exponent
underflow results in an early return from the calling subroutine (FDIV or
FMUL) with a floating point zero in FP1. Because MD2 pops a return address
off the stack, it may only be called by another subroutine.