Question: Question 1 ( 2 0 points ) The following program implements a stack that grows down toward high memory addresses as items are pushed, and

Question 1(20 points)
The following program implements a stack that grows down toward high memory addresses as items are pushed, and the stack pointer points to the top item on the stack.
```
ENTRY
LDR SP,=STACK
MOV r0, #0x11
MOV r1, #0x22
PUSH_R0 instruction_1
PUSH_R1 instruction_2
POP_R0 instruction_3
POP_R1 instruction_4
Loop B Loop
space 32
STACK DCD 0x0
space 32
END
```
AREA prog, CODE, READWRITE
Using ONLY LDR/STR instructions:
- Write one instruction (instruction_1) to push the value of RO onto the stack.
- Write one instruction (instruction_2) to push the value of R1 onto the stack.
- Write one instruction (instruction_3) to pop from the stack a value and to save it in RO.
- Write one instruction (instruction_4) to pop from the stack a value 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 3rd instruction are:
The mnemonic of the 4th instruction is:
The operands of the 4th instruction are: How many elements can be pushed onto this stack?
Encode the 1st instruction to ARM machine language code. Write your answer as eight hexadecimal digits, each digit in a box. 0x
A A A A A A A A A A A A A A
Question 1 ( 2 0 points ) The following program

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!