FLAG = $18000 RESULT = $18100 BUF = $20000 org $10000 start: move.l #1,FLAG.l lea RESULT,a2 moveq #0,d4 outer: move.l d4,d1 ; encoding A: PDA in bits 31-24 add.l #$80,d1 swap d1 lsl.l #8,d1 bsr.s doread move.l d0,(a2)+ move.l d4,d1 ; encoding B: PDA in bits 15-8 add.l #$80,d1 lsl.l #8,d1 bsr.s doread move.l d0,(a2)+ addq.l #1,d4 cmpi.l #16,d4 bne.s outer move.l #$FF,FLAG.l stop: bra.s stop doread: movem.l d2-d7/a2-a6,-(sp) moveq #$46,d0 moveq #0,d2 move.l #256,d3 lea BUF,a1 trap #15 movem.l (sp)+,d2-d7/a2-a6 rts