 nam test
 org $c000
 ldx #message
 ldy #$c800
 bsr print
 swi
 nop
print ldaa #$0d
 jsr out
 ldaa #$0a
 jsr out
l3 ldaa 0,x
 cmpa #$04
 beq l2
 jsr out
 inx
 bra l3
l2 rts
out ldy #$9800
 ldab 0,y
 bitb #$2
 beq out
 anda #$7f
 staa 1,y
 rts
message fcc 'THIS IS A TEST PROGRAM'
 fcb $04
 end
 
