Complete the code to save a callee-saved register before using it.
push [1]In ARM architecture, registers r4 to r11 are callee-saved. Saving r4 with push r4 preserves its value across function calls.
Complete the code to restore a callee-saved register after use.
pop [1]Register r5 is callee-saved in ARM. Restoring it with pop r5 returns its original value after the function finishes.
Fix the error in the code to properly preserve callee-saved registers.
push [1]
// function code
pop r4The code pushes r5 but pops r4, which is incorrect. Both push and pop must use the same register to preserve its value properly.
Fill both blanks to save and restore two callee-saved registers correctly.
push [1], [2] // function code pop r7, r8
Registers r7 and r8 are callee-saved. Saving them with push r7, r8 and restoring with pop r7, r8 preserves their values across the function.
Fill all three blanks to create a dictionary mapping callee-saved registers to their save instructions.
registers = [1]: '[2]', [3]: 'push [3]'
This dictionary maps r4 to its save instruction push r4 and r7 to push r7. Both are callee-saved registers.