December 6,20r7 Interesting problems 1. In the system below a push button switch
ID: 2266056 • Letter: D
Question
December 6,20r7 Interesting problems 1. In the system below a push button switch has been attached to GPIO Port A3 and a transistor with an LED has been attached to GPIO Port B2. Write a sequence in ARM assembly code to run forever and turn on the LED as long as the switch is closed. You may assume that GPIOA has been set up as input and GPIOB has been set up as output and the port clocks have been enabled. The address of GPIOA IDR is 0x40020010 and the address of GPIOB_ODR is 0x40020414 ARM Nucleo Board Rc LED Rb GPIOA 3Explanation / Answer
;PROGRAMME TO TURN ON LED AS LONG AS SWITCH IS CLOSED
OP1 EQU 0X40020010
OP2 EQU 0X40020414
LDA OP1 ;LOADS OPERAND1
MOV B,A ; MOVES THE OPERAND TO ACCUMILATOR
LDA OP2 ; LOADS OPERAND 2
COMP OP1 ,1 ; OP1 EQUALS TO 1
MOV OP2,1 : MOVE 1 TO OPERAND 2
HLT ; END
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.