Re: [Linux-decnet-user] librms + vax floating point
Brought to you by:
chrissie_c,
ph3-der-loewe
|
From: Mats M. <mat...@te...> - 2005-08-11 11:43:11
|
On Wed, 10 Aug 2005 14:39:19 +0100 ada...@br... wrote: > im successfully using librms to open and read a binary file on a vax > system. > > using '#pragma pack (1)' i was able to get my struct to be the same > size as the record length of the file, and can read most of the data > successfully, including strings and ints. But floats are a problem, > they are totally wrong. I figure vax maybe stores floats in a > different format from my i386 pc, and have found various references to > things like > > vax 'D-Float' format > and > TARGET_FLOAT_FORMAT VAX_FLOAT_FORMAT (but i think that is for cros > compiling). A small hint is that there is that if I recall correct there isn't just one float format on VAX, there is in fact several float formats. A hint is to look for some information about vax assembler, that is probably a good place to find information about floats. The last resort is to write a file with "known data" like 0, 1, 2, 0.5 e.t.c and have a look at the floats shown as binary data. Not really the best solution but a last resort. I'm not sure but I remember something like that floats can be 80 or 64 bits wide and can also be with large precition or can handle large exponents, atleast the smaller 64bit floats, perhaps the 80bit float handles max precition and max exponent size at the same time and conversion takes place when reading/writing to/from memory from/to registers or something like that. I'm not even sure that it's 64 and 80 bits, but this should be some kind of starter for you to try your google skills. If everything else fails I might have some papers about vax assembler from school but they are storend "below and behind everything else" so if I even have them it would take a good amout of time to find them. |