Apple ii Battery Charger User Manual


 
|_____| |_____| |_____| |_____|
X1 M1
NORM1 subroutine (address $F455)
Purpose: To normalize a floating point value in FP1 when it is known the
exponent is not -128 (X1=0) upon entry.
Entry: An unnormalized number is in FP1. The exponent byte should not be 0
for normal use.
Exit: The normalized value is in FP1. E, FP2, SIGN, and SCR are not not
disturbed. The A-REG is altered but the X- and Y-REGs are not.
ADD Subroutine (address $F425)
Purpose: To add the two mantissas (M1 and M2) as 3-byte integers.
Entry: Two mantissas are in M1 (through M1+2) and M2 (through M2+2). They
should be aligned, that is with identical exponents, for use in the FADD
and FSUB subroutines.
Exit: the 24-bit integer sum is in M1 (high-order byte in M1, low-order
byte in M1+2). FP2, X1, E, SIGN and SCR are not disturbed. The A-REG
contains the high-order byte of the sum, the X-REG contains $FF and the
Y-REG is not altered. The carry is the '25th' sum bit.
Example: FP1 contains +5 and FP2 contains +7 prior to calling ADD.
_____ _____ _____ _____
| | | | | | | |
FP1: | $82 | | $50 | | 0 | | 0 | (+5)
|_____| |_____| |_____| |_____|
X1 M1
_____ _____ _____ _____
| | | | | | | |
FP2: | $82 | | $70 | | 0 | | 0 | (+7)
|_____| |_____| |_____| |_____|
Upon exit, M1 contains the overflow value for +12. Note that the sign bit
is incorrect. This is taken care of with a call to the right shift
routine.
_____ _____ _____ _____
| | | | | | | |
FP: | $82 | | $C0 | | 0 | | 0 | (+12)
|_____| |_____| |_____| |_____|