start:
        ; Force screen to be shown
        move.l  $4.w,a6
        lea     dosname(pc),a1
        jsr     -408(a6)
        move.l  d0,a6
        lea     str(pc),a0
        move.l  a0,d1
        jsr     -948(a6)
.wait:
        bsr     test
        btst.b  #6,$bfe001
        bne.b   .wait
        rts
dosname: dc.b 'dos.library',0
str:    dc.b 'test',10,0
        even
test:
        bsr     test2
.w:     move.l  $dff004,d0
        and.l   #$1ff00,d0
        bne     .w
        rts
val:    dc.l    0
test2:
        lea     val(pc),a0
        addq.l  #1,(a0)
        rts
