...cont'd....
I found this in a later version of the source. I haven't checked the original, but I expect to find something similar...
*-------------------------------------------------------*
text
*-------------------------------------------------------*
*-------------------------------------------------------*
expose_detect:
*-------------------------------------------------------*
* Set up bus handler *
*-------------------------------------------------------*
move.l $8.w,-(sp)
move.l #.bus_handler,$8.w
*-------------------------------------------------------*
* Assume expose present *
*-------------------------------------------------------*
st expose_flag
*-------------------------------------------------------*
* Resynchronizing nop *
*-------------------------------------------------------*
nop
*-------------------------------------------------------*
* Access error if Expose not available *
*-------------------------------------------------------*
tst.w DIGICTRL
bra.s .bus_return
*-------------------------------------------------------*
* Access error handler *
*-------------------------------------------------------*
.bus_handler:
*-------------------------------------------------------*
sf expose_flag
*-------------------------------------------------------*
* Get stack frame format *
*-------------------------------------------------------*
move.b 6(sp),d0
lsr.b #4,d0
*-------------------------------------------------------*
* Handle 68020/30 short/long buserr formats *
*-------------------------------------------------------*
cmp.b #7,d0
beq.s .bus40
cmp.b #10,d0
beq.s .bus30
cmp.b #11,d0
beq.s .bus30
*-------------------------------------------------------*
* Unknown stackframe format *
*-------------------------------------------------------*
rte
*-------------------------------------------------------*
* 68020/30 buserr stackframe cleanup *
*-------------------------------------------------------*
.bus30: and.w #$feff,10(sp)
rte
*-------------------------------------------------------*
* 68040 access error stackframe cleanup *
*-------------------------------------------------------*
.bus40: move.l #.bus_return,2(sp)
rte
*-------------------------------------------------------*
* 68040 return address *
*-------------------------------------------------------*
.bus_return:
*-------------------------------------------------------*
* Restore bus handler *
*-------------------------------------------------------*
move.l (sp)+,$8.w
*-------------------------------------------------------*
rts
*-------------------------------------------------------*
bss
*-------------------------------------------------------*
expose_flag ds.b 1
even
*-------------------------------------------------------*
text
*-------------------------------------------------------*