;**************************************************************************
;***                                                                    ***
;*** Everyday Electronics Micro-Lab                                     ***
;***                                                                    ***
;***    Name:           Demonstration 1                                 ***
;***    Version:        1.0                                             ***
;***    Author:         Geoff MacDonald                                 ***
;***    Date:           13/01/1993                                      ***
;***    Last Update:                                                    ***
;***                                                                    ***
;**************************************************************************

                ;Read a sequence beginning at address $0200, of length
                ;stored at $0300 and send the sequence to the 7 segment LED
                ;waiting for a key press between each output.

D_DEMO1:        LDA     #$00            ;Set up start address of table
                STA     $90
                LDA     #$02
                STA     $91
                LDY     #$00            ;Get byte to send to LEDs
DEMO1A:         CPY     $0300           ;End of table?
                BEQ     DEMO1B          ;Yes - terminate
                LDA     ($90),Y
                STA     LED          ;Set up segment LEDs
                JSR     KBWAIT          ;Wait for key to be pressed
                INY                     ;Point to next value
                JMP     DEMO1A
DEMO1B:         LDA     #$FF            ;Clear 7-segment LED
                STA     LED
                BRK
