[EMAIL PROTECTED] wrote:
> Not with the LOAD/SAVE op code as far as I can see, they always take
> 6 bytes from the A1 stack and load back 6 bytes. There is no way
> that I can see (using the maths package) to load and save a word for
> example.
Yes, but nobody tells you that the data area is just for FP data.
> So, the word exponent of my FP gets written to -2(A6,A4) and the
> long word mantissa is written ABOVE my variables area at (A6,A4) for
> 3 bytes - oops. (Data written to -2(A6,A4) to +3(A6,A4))
That is all correct. But I don't really see the problem here. Just
don't write above your variable area if you don't want the value to be
put there. ;-)
> I repeat my earlier (but slightly incorrect) observation that the
> code is broken. Because the load and save routines *always* copy 6
> bytes around, we shouldn't be allowed to use load and save op codes
> that will break the system or corrupt other variables in the saved
> area etc.
You still have total control over where the data is put.
Just as a simple example (not tested, just written as-is):
some_other_data
dc.w $1234
my_fp_value
dc.w 0,0,0
some_more_data_in_between
dc.w $abcd
data_top
[...]
lea data_top(pc),a4
suba.l a6,a4
move.w #my_fp_value-data_top,d0
jsr qa.op
> PS. I'm off to France next week, so any replies after today will be
> delayed in being read. I've got to drive on the wrong side of the
> road for a week - that should be fun.
You mean you'll be driving on the right side of the road. In both
meanings for the word "right" ;-)
Marcel
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm