Complete the code to push the link register onto the stack at the start of a function.
push [1]In ARM assembly, the link register (lr) holds the return address. Pushing {lr} saves it on the stack for later return.
Complete the code to allocate 16 bytes on the stack for local variables.
sub sp, sp, [1]Subtracting 16 bytes from the stack pointer reserves space for local variables in the stack frame.
Fix the error in the instruction that restores the stack pointer after a function call.
add sp, sp, [1]The stack pointer must be incremented by the same amount it was decremented to restore the stack frame correctly. If 16 bytes were allocated, add back 16 bytes.
Fill both blanks to correctly save and restore the frame pointer (r7) in the function prologue and epilogue.
push [1] ... pop [2]
The frame pointer register (r7) is saved at the start and restored at the end of the function to maintain the stack frame.
Fill all three blanks to create a stack frame setup that saves lr and r7, allocates 12 bytes, and restores them properly.
push [1] sub sp, sp, [2] ... add sp, sp, [3]
The push instruction saves both lr and r7 registers. Then 12 bytes are allocated on the stack. Finally, 12 bytes are added back to restore the stack pointer.