From Book: Embedded Systems: Introduction to the MSP432 Microcontroller (Volume
ID: 3751811 • Letter: F
Question
From Book: Embedded Systems: Introduction to the MSP432 Microcontroller (Volume 1). by Jonathan W. Valvano
NOTE: Put the code in a single line. Separate instructions with a few spaces.
NOTE: Select all that apply
Select one or more:
a. LDR loads R1 with the word located at the address R0 is pointing to. STR stores the word in R1 to the location R0 is pointing to.
b. LDRH loads R0 with the half-word located at the address R1 is pointing to, and loads 0's into the upper 16-bits. LDRSH also does this but it loads the MSB from the half-word into the upper 16-bits.
c. LDR loads R0 with the word located at the address R1 is pointing to. STR stores the word in R0 to the location R1 is pointing to.
d. LDRH loads R0 with the half-word located at the address R1 is pointing to, and loads 0's into the upper 16-bits. LDRSH also does this but it loads 1's into the upper 16-bits.
e. LDR loads R0 with the half-word located at the address R1 is pointing to. STR stores the half-word in R0 to the location R1 is pointing to.
f. LDRH and LDRSH are the same.
g. LDR loads R1 with the half-word located at the address R0 is pointing to. STR stores the half-word in R1 to the location R0 is pointing to.
3.10 Write assembly code that pushes registers R1 R3 and R5 onto the stack.Explanation / Answer
Answer is as follows :
Answer 10 : We use rbp reffister here i.e. preserved for stack operations
mov rbp , R1 // move value of R1 to rbp
push rbp // push rbp onto stack
mov rbp, R3 // move value of R3 to rbp
push rbp // push rbp onto stack
mov rbp,R5 // move value of R5 to rbp
push rbp // push rbp onto stack
Answer 11 :
The Correct options are B,C,D, E and F. Other options are incorrect about given set of instructions.
if there is any query please ask in comments...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.