M1+2 prior to calling FLOAT.
FLOAT takes approximately 3 msec. lonqer to convert zero to floating point
form than other arguments. The user may check for zero prior to calling
FLOAT and increase throughput.
*
* LOW-ORDER INT. BYTE IN A-REG
* HIGH-ORDER BYTE IN Y-REG
*
85 FA XFLOAT STA M1+1
84 F9 STY M1 INIT MANT1
A0 00 LDY #$0
84 FB STY M1+2
05 D9 ORA M1 CHK BOTH
BYTES FOR
D0 03 BNE TOFLOAT ZERO
85 F8 STA X1 IF SO CLR X1
60 RTS AND RETURN
4C 51 F4 TOFLOAT JMP FLOAT ELSE FLOAT
INTEGER
Example: Float +274 ($0112 hex)
CALLING SEQUENCE
A0 01 LDY #$01 HIGH-ORDER
INTEGER BYTE
A9 12 LDA #$12 LOW-ORDER
INTEGER BYTE
84 F9 STY M1
85 FA STA M1+1
A9 00 LDA #$00
85 F8 STA M1+2
20 51 F4 JSR FLOAT
Upon returning from FLOAT, FP1 contains the floating point representation
of +274.
_____ _____ _____ _____
| | | | | | | |
FP1 | $88 | | $44 | | $80 | | 0 | (+274)
|_____| |_____| |_____| |_____|
X1 M1
FIX subroutine (address $F640)
Purpose: To extract the integer portion of a floating point number with
truncation (ENTIER function).
Entry: A floating point value is in FP1. It need not be normalized.
Uses: RTAR.