avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] storing a float value to a 8-bit registers


From: Artur Lipowski
Subject: RE: [avr-gcc-list] storing a float value to a 8-bit registers
Date: Mon, 26 May 2003 10:28:27 +0200

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of Abhijeet D Mhatre
> Sent: 26 maja 2003 09:57
> To: address@hidden
> Subject: [avr-gcc-list] storing a float value to a 8-bit registers
>
...
> Now if I want to store the float value back to the 8 bit
> registers how do I do that?  Even if I know how many bytes are taken by
the float the
> float value will be in 2's complement. Can you tell me what methods are
usually used.
The avr-libc library stores floats and doubles in four bytes in "special"
format which consists of four parts: sign, exponent, fraction and fraction
extention. For details look into avr-libc sources (eg. fp_split.S file).
You can implement what you want using a standard C union + structure with
bitfields.

Why you nedd to "manually" load float into registers?

Reagrds
--
Artur Lipowski



reply via email to

[Prev in Thread] Current Thread [Next in Thread]