A86: Re: OPS


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

A86: Re: OPS




>I seriously don't understand the whole OP1, OP2...OP6  thing... I tried
>loading a value into OP1 (ld OP1,a) and it just doesn't work -- so would
>someone mind telling me how to use the OP1 etc.  I also haven't gotten much
>help from the Assembly Studio Help File or from Tutorials... maybe I just
>missed something.
>
>--Joe


as far as i know, OP registers are just blocks (10 bytes) of memory divided
into the mantissa, sign and the exponent of a floating point number.

It's divided up like this:

Byte       Represents
0:           Sign
1:           Exponent
2:           Exponent
3:           Mantissa
4:           Mantissa
5:           Mantissa
6:           Mantissa
7:           Mantissa
8:           Mantissa
9:           Mantissa

So for example:

Number:
.db $00, $03, $FC, $20, $24, $56, $31, $23, $78, $90

this equals 2.0245631237890x10^3

why? $00 is the sign (positive)
you need to subtract the $FC00 from the exponent (lsb stored first) so, in
this case, its $FC00-$FC03=$0003
The next digits are stored in BCD format (meaning that no hex digit goes
above 9 -- $1234 equals 1,234)

 if you just do ld (OP1), a, you'll just be changing the sign byte

re-read teh assembly studio stuff -- it is pretty helpful.


-- Stephen Michael Horne