Code: Select all
*-----------------------------------------------------------------------------*
EXXOS_BusErrorTest:
*-----------------------------------------------------------------------------*
move.l bas_params(pc),a0 ; a0 = basic variable ptr
move.l (a0),a1 ; a1 = basic variable (address to test)
move.l sp,d2 ; d2 = old stack pointer
move.l $8,d1 ; d1 = old berr handler
move.w #.berr-EXXOS_BusErrorTest,d3 ; d3 = err handler offset
lea EXXOS_BusErrorTest(pc,d3.w),a2 ; a2 = err handler absolute address
move.l a2,$8 ; set new berr handler
move.l (a1),d0 ; read from address
move.l d1,$8 ; restore berr handler
move.l #1,(a0) ; return 1
rts
.berr:
move.l d2,sp ; restore stack to before berr
move.l d1,$8 ; restore berr handler
move.l #0,(a0) ; return 0
rts
So I did a test routine where I could return to separate values by doing this..
Code: Select all
move.l bas_params(pc),a0 ; a0 = basic variable ptr 6 ?
move.l (a0),a1 ; a1 = basic variable (address to test) FF8964
move.l #1234,(a0) ; return 1234 in X&
move.l #5678,4(a0) ; return 5678 in Y&
rts
So I make the assumption that return 1 and return 0 get changed from #0,(a0) TO #0,4(a0) as that is what worked in my test routine.
However something has broken in the bus error handler and I have no idea what. I thought it was down to those code changes but even if I comments them out the handler crashes
If I simply put a RTS the start of the code then things don't crash. So definitely wrong with that bus error handler routine somehow