Eight switches are connected to PORTB and eight LEDs are connected to PORTA. We would like to monitor the first two least significant bits of PORTB (use masking technique). Whenever both of these bits are set, switch all LEDs of Port A on for one second. Assume that the name of the delay subroutine is DELAY. You do not need to write the code for the delay procedure.

Respuesta :

Answer:

In this example, the delay procedure is given below in the explanation section

Explanation:

Solution

The delay procedure is given below:

LDS # $4000 // load initial memory

LDAA #$FF

STAA  DDRA

LDAA #$00 //load address

STAA DDRB

THERE LDAA PORT B

           ANDA   #%00000011// port A and port B

           CMPA   #%0000011

           BNE     THERE

           LDAA   #$FF

           STAA    PORT A

           JSR       DELAY

           LDAA    #$00

           STAA     PORT A

           BACK     BRA BACK