[Coco] Re: GCC: DFLOAT / DIRECT_PAGE
jdaggett at gate.net
jdaggett at gate.net
Sat Nov 15 10:10:01 EST 2003
On 14 Nov 2003 at 8:23, Theodore A. Evans wrote:
> On 11/14/03, John E. Malmberg wrote:
>
> > It looks like I need to define some instructions to operate on a
> > double float for the compiler to be happy. I have to look up in the
> > ANSI C specifications to see what the minimum size for a double is,
> > and review the 6809 instruction set to see how it could be
> > implemented.
> >
> > The simplest case would be if I can alias it to be the same as a
> > float. I do not think I will be that lucky.
>
> I am almost positive that the standard merely states that a double has
> at least as much precision as a float, so you should be able to define
> it as being exactally the same. OTOH, in Microware C a double uses 8
> bytes.
>
****************************************
Double precision Floating point in packed form is 64 bits.
1 sign bit 11 exponent bits, 52 bit fractional portion of the mantissa.
It is assumed that the Integer part will always be one.
The 11 bits allow a number from 0 to 1.F * 2^2048 or by biasing the exponent, 1.F *
2^-1024 to 1.F * 2^ 1023.
In unpacked form the DP FP # will require a minimum of 10 bytes of memory. You
will need to unpack the FP number to work with it. The sign bit becomes a sign byte
and the exponent is in two bytes. Now the remaining seven bytes is a matter of
preference. Six bytes and one niblle will be the fractional part of the mantissa and
the lone nibble will represent the integer part. How the bytes are processed is a
matter of preference. One needs to remember the not cross the order of the bits.
Extended format packed is 80 bits and quad precision is 128 bits.
james
> --
> I'm experimenting with homosexuality, said Tom, half in earnest.
> Theodore (Alex) Evans | alxevans at concentric.net
> 94-1071 Kepakepa St. Unit #C-1 | http://www.concentric.net/~alxevans
> Waipahu, HI 96797 | ICQ 78089262 x
> | (808) 676-0123 2B v ~2B = ?
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list