Apple II User Manual

Page of 257
Note: M1 sign bit is unchanged.
RTLOG subroutine (address $F480)
Purpose: To shift the 6-byte field MANT1 and E one bit to the right (toward
the least significant bit).  The 6502 carry bit is shifted into the
high-order M1 bit.  This is useful in correcting binary sum overflows.
Entry: A normalized or unnormalized floating point value is in FP1.  The
carry must be cleared or set by the user since it is shifted Into the sign
bit of M1.
Exit: Same as RTAR except that the sign of M1 is not preserved (it is set
to the value of the carry bit on entry)
Caution: Same as RTAR.
Example: Prior to calling RTLOG, FP1 contains the normalized value -12 and
the carry is clear.
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $83 |  | $A0 |  |  0  |  |  0  |   (-12)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
After calling RTLOG, M1 is shifted one bit to the right and the sign bit is
clear.  X1 is incremented by 1.
      _____    _____    _____    _____
     |     |  |     |  |     |  |     |
FP1: | $84 |  | $50 |  |  0  |  |  0  |   (+20)
     |_____|  |_____|  |_____|  |_____|
       X1       M1
Note: The bit shifted off the end of MANT1 is rotated into the high-order
bit of the 3-byte extension E.  The 3-byte E field is also shifted one bit
to the right.
RTLOG1 subroutine (address $F484)
Purpose: To shift MANT1 and E right one bit without adjusting X1.  This is
used by the multiply loop.  The carry is shifted into the sign bit of
MANT1.
Entry: M1 and E contain a 6-byte unsigned field.  E is the 3-byte low-order
extension of MANT1.
Exit: Same as RTLOG except that X1 is not altered and an overflow exit
cannot occur.