In the HCS12 There are eight switches connected to PORTD and
In the HCS12 There are eight switches connected to PORTD and eight LEDs connected to PORTA. Write a program to monitor the switches continuously. Whenever the value of the switches becomes less than or equal to $65, turn all of the LEDs on. (Points : 5)
Solution
LDAA #$00
STAA DDRC
LDAA #$FF
STAA DDRB
THERE LDAA PORTD
CMPA #$65
BLS THERE
LDAA #$FF
STAA PORTA
BRA THERE
