Re: [hatari-devel] 68000: Wrong order of bus accesses for move.l xx,-(Ay)

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


>> This should fix it. Also fixes exception stack frame fault address if
>> MOVE.L ea,-(an) causes address error.
> 
> Thank you. I didn't try applying the patch to Hatari source code, so I
> have to ask: Does it also fix MOVEM.L xx,-(An), which also writes in
> descending order?

No but next fix will :)

> Also, this issue prompted me to go through the "YACHT" document, looking
> for unusual access patterns. For example ADDX.L -(An),-(Ay) does the
> *reads* in descending order. I have tested on a real 68000 that...
> 
> LEA $0,A0
> LEA $1000,A1
> ADDX.L -(A0),-(A1)
> 
> ... does in fact generate the bus error at $FFFFFFFE. In Hatari (and
> thus in the UAE emulation) it will generate the bus error at $FFFFFFFC.
> Same goes for SUBX.L. The writes are also in descending order, as I just
> tested.

There is even more unknowns, I did some quick tests with address error
(bus error does not exist in Amigas) and different instruction variants
modify address register differently:

An = odd address, log An content and fault address in exception routine:

movem.l d0,-(an) ; An not modified, fault address - 2
move.l d0,-(an) ; An not modified, fault address - 2
move.l -(an),d0 ; An - 4, fault address - 4
not.l -(an) ; An - 4, fault address - 4

In above cases it would be interesting to see what An contains in bus
error exception when second word access causes bus error.

Same for (an)+ addressing mode, some instructions probably have already
added An by 2 before second word access.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/