Re: A86: Real variable format.


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

Re: A86: Real variable format.



In a message dated 97-10-31 07:23:40 EST, you write:

> 
>  Does anyone know what format the real numbers are stored in? Are they just
>  double-precision IEEE-standard floating point numbers, or what?
>  
>  --Joshua
>  

They're really wierd.  This is the format:

Offset:Function
----------------------
0:Sign byte
    bit 0: set if negative, reset if positive
    bit 7: set if part of a complex #
1-2:Exponent byte
    This byte is stored in reverse word (you know, high byte first) format,
and (for some freaky reason) is $FC00+Exponent.  (i.e., 0 is stored 00 FC and
-1 is FF FB)
3-9:Mantissa
    Stored in BCD (i.e. 1.9876 would be stored 19 87 60 00 00 00 00)
10:(OP registers only) Extension
    I have no clue what this does...

In conclusion, here are a few examples:

123 -> 1.23ee2 -> 00 02 FC 12 30 00 00 00 00 00
0.0002 -> 2ee -4 -> 00 FC FB 20 00 00 00 00 00 00
9.9999999999999ee256 -> 00 00 FD 99 99 99 99 99 99 99

Hope this clears it up

~Steve