Using only 3 ARM instructions without using any LDR or STR instructions, show how to store the current value of the frame pointer in the stack, make the frame pointer to point to the base of this frame, and create an 8-byte stack frame while the stack pointer to point to the top of the stack. Assume that an FD stack is in use, appropriate stack space is already allocated to the stack, and the stack pointer is appropriately initialized. The first instruction is The second instruction is The third instruction is
**Expert Solution
arrow_forward
Step 1
Frame:
The stack frame, additionally referred to as activation record is that the assortment of all information on the stack related to one subroutine decision.
The stack frame typically includes the subsequent components:
The destination
Argument variables passed on the stack
Local variables (in HLLs)
Saved copies of any registers changed by the subroutine that require to be fixed up (e.g. $s0 - $s8 in MAL).
arrow_forward
Step 2
Instructions:
Instruction:
pushw(
r
a
)
p
u
s
h
w
(
ra) pushw(
ra)pushw(a0)
pushw($a1)
popw($a1)
popw($a0)
popw($ra)
addi $sp, $sp, -12
sw
r
a
,
0
(
ra, 0(
ra,0(sp)
sw
a
0
,
4
(
a0, 4(
a0,4(sp)
sw
a
1
,
8
(
a1, 8(
a1,8(sp)
lw $a1, 8($sp)
lw $a0, 4($sp)
lw $ra, 0($sp)
addi $sp, $sp, 12
Address Content
$sp --> FF00 Saved return address
FF04 Saved value from $a0
FF08 Saved value from $a1
**