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

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


while reproducing a crash seen on a real ST using Hatari I found what I
think is a wrong order of bus accesses during MOVE.L (and possibly other
instructions) when using register pre-decrement address mode as the
destination. This is for ST emulation (68000 CPU), where a long word
access is split into two bus accesses.

Consider the following test program that does a...

MOVE.L D0,-(A0)

.... with A0 being 0. This will of course trigger a bus error. The access
address of this error read from the exception stack frame is then printed.

On a real ST, you'll see the message "Bus error at: $FFFFFFFE", i.e. the
least significant word is written first and causes the bus error. This
agrees with what's documented in "Yet Another Cycle Hunting Table". On
Hatari, however, you'll see "Bus error at: $FFFFFFFC", i.e. the most
significant word seems to be written first. (I tested this with the
latest Hatari build from antartica.no.)

Apart from a wrong stack frame, this can cause other issues, e.g. when
writing to hardware registers where the order of the accesses can be

Christian Zietz  -  CHZ-Soft  -  czietz@xxxxxxx
WWW: http://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA

Attachment: MM_BERR.PRG
Description: Binary data

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