Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume initialization and start code are provided. Write the code in loop for fo

ID: 3835060 • Letter: A

Question

Assume initialization and start code are provided. Write the code in loop for following program requirements. Conditional branch instructions are not accepted. Use shift and logic operations to write this program.; PE3 is switch input (1 means switch is not pressed, 0 means switch is pressed); PE4 is switch input (1 means switch is not pressed, 0 means switch is pressed); PE2 is LED output (0 means door is locked, 1 means door is unlocked); The specific operation of this system is to; unlock if both switches are pressed Init ... Start BL Init LDR R0, = GPIO_PORTE_DATA_R LDR R1, [R0] Loop

Explanation / Answer

# Code of LOOP

#LOGIC : If we use Logic OR operator then output wolud be 0 if both flags are false. For the output if we use NOT operation to LED Flag then we can get result output.

# If we assume R1 is PE2, LED Ouptu

#AL, BL are two switches

OR AL, BL   

NOT AL

MOV R1, AL # final output moving to R1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote