Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
130 user(s) are online (111 user(s) are browsing Forums)

Members: 0
Guests: 130

more...

Support us!

Recent OS4 Files
OS4Depot.net

Report message:*
 

Re: Reading "double" values from an Intel file

Subject: Re: Reading "double" values from an Intel file
by Daytona675x on 2015/11/2 10:41:10

@thellier
It should be the reverse byte-order, just like it is for other types. If you tried that and if it doesn't work then you most likely simply got a typo in your shift / OR / AND orgy.
This should do:

#define ANTI_ENDIAN_64(a) 
(((a) << 56) | 
(((
a)<<40) & 0x00FF000000000000ull) | 
(((
a)<<24) & 0x0000FF0000000000ull) | 
(((
a)<<8) & 0x000000FF00000000ull) | 
(((
a)>>8) & 0x00000000FF000000ull) | 
(((
a)>>24) & 0x0000000000FF0000ull) | 
(((
a)>>40) & 0x000000000000FF00ull) | 
((
a) >> 56))


Or use a union of double and 8 chars and simply swap char[x] and char[7-x] (x>=0, x<4).

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project