Re: A86: Re: OP1


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

Re: A86: Re: OP1




Format of real #'s:

Sign byte; Exponent (2 bytes); Mantissa (7 bytes)

sign byte: $80 for negative, $00 for positive (add 1 if it's part of
complex)
exponent: $FC00+exponent (remember to store low byte first)
mantissa: 7 bytes in BCD

Andy S Johnson wrote:

> So how do you get a negative number?
> ---
> Andy Johnson
> "Change is inevitable...
>      except from vending machines"
>
> On Fri, 20 Mar 1998 21:31:55 -0500 "Matt2000" <matt2000@gte.net> writes:
> >
> >>It's pretty simple, it's just biased by FC00 - that is, FC00 (stored
> >as
> >>00,FC) is an exponent of 0. Take the exponent you want and add FC00
> >to get
> >>those two bytes. The rest of the OP is just the number in BCD (i.e.
> >123
> >>would be stored as $12,$30).
> >
> >
> >Oh ok thanks dude. I understand now. This threw me off
> >
> >FPNum3: ;-3.6512000000000e-04 = -.00036512
> > .db $80, $FC, $FB, $36, $51, $20, $00, $00, $00, $00
> >
> >But when $FC00 is subtracted by 4 you get $FBFC and then you reverse
> >it to
> >get the correct exponent. Cool, thanks
> >
> >-Matt
> >
> >
>
> _____________________________________________________________________
> You don't need to buy Internet access to use free Internet e-mail.
> Get completely free e-mail from Juno at http://www.juno.com
> Or call Juno at (800) 654-JUNO [654-5866]



--
Stephen Hicks
mailto:shicks@mindspring.com
ICQ:5453914
IRC:Kupopo



References: