1
/* -*- Mode: Asm -*- */
3
frexp.S is part of FPlib V 0.3.0 ported to avr-as
4
for copyright and details see readme.fplib
6
*----------------------------------------------------------------------------------------
8
* A = mantissa(A) *integ = exponent(A)
11
* double fract = frexp( 3.45, &integ ) = frexp ( 2^2 * 0.8625 )
12
* -> fract = 0.8625; *integ = 2
20
TEXT_SEG(fplib, frexp)
28
RCALL _U(__fp_split1) ;
31
SUBI rA3,0x7E ; 0.5 -> 0.5 * 2^0
33
SBC rB0,rB0 ; sign expand rA3
37
ANDI rA2,0x7F ; mantissa is normalized
38
LDI rA3,0x3F ; exponent for 0.5
45
RJMP _U(__fp_zero) ; frexp(0) returns 0 not A = 0x00800000 of fp_split1