[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> 
> >>Not only that, but codes from -5 through to -1 will overwrite data at 
> >>the top of your A4 stack.
> 
> Ignore that. I'm a pillock. I've got my mental stack upside down again :o(
> 

Actually, I may not be a pillok after all ! Correct me if I'm wrong (again) but 
:

(A6,A4) is a pointer to the TOP of my variables area - the highest address I 
want to use. Save code $FFFF will get converted to a starting address of 
A6+A4+FFFE or A6+A4-2.

The following code is then executed by the save to variables area :

        move.w  (a1)+,(a4,d0.w)
        move.l  (a1)+,2(a4,d0.w)         ; store

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))

Something similar happens at op codes $FFFD where we write to address -4(A6,A4) 
and overwrite one byte above the top of variables area (data written to 
-4(A6,A4) to +1(A6,A4))

So, in practice, the safest save op code has to be $FFFB (-5) which will safely 
write data into the variables area at -6(A6,A4) to -1(A6,A4) without exceeding 
the boundary set by my area TOP pointer of A4.

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.

I'm looking forward to hearing back from you all :o)

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. If you are anywhere around Marseilles, Carcasson, 
Aix-en-Provence then stay off the roads.

Cheers,
Norman.

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to