********** * Program LITE_ALL (6811) * * Fetches switches. If all switches at logic one outputs $FF to LEDs * Otherwise outputs $00. * * Illustrates use of the zero flag. * * P. H. Anderson, MSU, 12 Sept 91; Checked 12 Sept 91; 15 Jan 93 ********** PSCT EQU $C000 PORTB EQU $1004 PORTC EQU $1003 DDRC EQU $1007 ORG PSCT CLR DDRC TOP LDAA PORTC * get switches COMA * invert data BEQ ALL_ONES BNE NOT_ALL_ONES ALL_ONES LDAA #$FF * output $FF STAA PORTB BRA TOP NOT_ALL_ONES CLR PORTB * output $00 BRA TOP