;
; Micro-KIM demos
; (C) 2016 by Aart Bik
;
; For use with cross-assembler
; win2c64 (Windows), lin2c64 (linux),
; or mac2c64 (MacOS)
;
; http://www.aartbik.com/
;
; Control the 6 characters of the LED display.
;

;
; Define symbols for the 6532 RIOT addresses.
;
sad  = $1740   ; A data register
padd = $1741   ; A data direction register
sbd  = $1742   ; B data register
pbdd = $1743   ; B data direction register

;
; Start program at free RAM.
;
.org $0200

;
; Set the 6532 RIOT data direction registers.
; 
             lda #$7f
             sta padd
             lda #$3f
             sta pbdd
;
; Main loop for display.
;
display_loop ldx #0
             ldy #9
char_loop    lda #0
             sta sad          ; no flicker
             sty sbd
             lda data, x
             sta sad
             txa
             ldx #4
char_delay   dex
             bne char_delay  ; glow up character
             tax
             inx
             iny
             iny
             cpx #6
             bne char_loop
;
; Keep refreshing.
;           
             jmp display_loop
;
; Data to display.
;
data .byte $f7 $f7 $d0 $f8 $00 $fc

