*** name 'demo1.txt - a simple demonstration of 6809+apple' title '(c) 1981, conejo computer products' page * file=demo1.txt * 6809 / apple demo prog * runs a counter on top line *** opt num org 4096 ; <<< change as desired <<< screen equ $7f0 ; crt address beep equ $c030 ; i/o for speaker start bra begin adr fdb $628 ; screen addr begin leas endp+232,pc ; set stack pointer ldx adr,pc ; screen address leay msg1,pc ; "6809 COUNTING ...." l100 lda ,y+ sta ,x+ bne l100 l200 ldb #'0' ; ASCII ZERO leay msg1a,pc ; buffer address inc 6,y ; from here we increment bcd digits lda 6,y ; by adding 1 til '9' then do carry cmpa #'9' bls l300 stb 6,y inc 5,y lda 5,y cmpa #'9' bls l300 stb 5,y inc 4,y lda 4,y cmpa #'9' bls l300 stb 4,y tst beep ; click speaker inc 3,y lda 3,y cmpa #'9' bls l300 stb 3,y inc 2,y lda 2,y cmpa #'9' bls l300 stb 2,y inc 1,y lda 1,y cmpa #'9' * inc a ;start lda * ; bra start bls l300 stb 1,y inc ,y lda ,y cmpa #'9' bls l300 stb ,y l300 leax msg1,pc ; send data to crt ldy adr,pc l400 lda ,x+ ; move local to crt memory sta ,y+ bne l400 bra l200 ; main loop msg1 fcc "6809 COUNTING " msg1a db "0000000",0 cnt equ msg1a-msg1 endp equ * end start