Q7: SP: 0x20000818 LR: 0x08000791 PC: 0x0800068C
Q8: It points to address 0x0800068C which is tje same address stored by the PC, which makes sense as the PC is meant to point to the code running
Q9: SP, and PC have changed, PC changed cause we have skipped forward by an instruction and SP changed cause the line 0800068C explicitly subtracts 24 from the SP, (sub sp,sp,#0x28)
Q10: Yes, the STRD instructions from 0x08000692 have 4 bytes the first two bytes are both E9CD.
Q11: SP: 0x20007F0 LR: 0x08000791 PC: 0x0800069E
Q12: LR and PC changed, SP not changed:
LR is now 0x080006A3 PC is now 0x0800023C
PC changed as we’re now inside the function, and LR changed to point back to where we were
Q13: src is in r0 0x20000808 dst is in r1 0x200007F4
Q15, in r0, the data Hello World! is stored Q16, nothing is stored
Q17, in r2
Q18 character/r2 = nothing src pointer = Hello World! dst pointer = Hello World! LR = 0x080006A3 PC = 0x08000248
Q19/20 PC is now 0x080006A2 which is the same (ignoring last bit) as LR This makes sense as LR was pointing to the next instruction in the main loop after the function call, which means when the function call finished, we set the PC to the value in LR, so that we could return to main
a 1010 10 01 000000