Question
Consider an 8-pin general purpose input/output port memory mapped to address adr_gpio_a . What does the following code do? ldr r0, adr_gpio_a ldr r1,
Consider an 8-pin general purpose input/output port memory mapped to address " adr_gpio_a ". What does the following code do?
ldr r0, adr_gpio_a ldr r1, =0xfb str r1, [r0, #4] ldr r2, [r0]
- A.
Sets pin 2 as input, the remaining pins (0,1, 3..7) as output, then reads from pin 2.
- B.
Sets pin 2 as output, the remaining pins (0,1, 3..7) as input, then reads from every pin except pin 2.
- C.
Writes the value 0xfb to the memory cell adjacent to the i/o port, then reads input from all of the pins in the port.
- D.
Reads the input from the i/o port and applies a bit mask of 0xfb.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started