Question: Question 1 options: The following program implements a stack that grows up toward low memory addresses as items are pushed, and the stack pointer points

Question 1 options:
The following program implements a stack that grows up toward low memory addresses as items are pushed, and the stack pointer points to the top item on the stack.
AREA prog, CODE, READWRITE
ENTRY
LDR SP,=STACK
MOV r0, #0x11
MOV r1, #0x22
PUSH_R0 instruction_1
PUSH_R1instruction_2
POP_R0instruction_3
POP_R1instruction_4
Loop B Loop
space 32
STACK DCD 0x0
space 32
END
Using ONLY LDR/STR instructions:
-Write one instruction (instruction_1) to push the value of R0 onto the stack.
- Write one instruction (instruction_2) to push the value of R1onto the stack.
- Write one instruction (instruction_3) to pop from the stack avalue and to save it in R0.
- Write one instruction (instruction_4) to pop from the stack avalue and to save it in R1.
Make sure that the values of R0 and R1 are swapped after these operations.
What are the 4 instructions you used?
Write your answer (i.e., the 4 instructions) in TWO parts, the mnemonic in a box and ALL operands in another box.
To facilitate automatic marking,
- Use CAPITAL letters ONLY--except 0x, make it a small letter.
- Do NOT leave ANY spaces between operands.
The mnemonic of the 1st instruction is: ____
The operands of the 1st instruction are: ____.
The mnemonic of the 2nd instruction is: ____
The operands of the 2nd instruction are: ____.
The mnemonic of the 3rd instruction is: ____
The operands of the 3rdinstruction are: ____.
The mnemonic of the 4th instruction is: ____
The operands of the 4th instruction are: ____.
How many elements can be pushed onto this stack? ____

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!