I'm currently developing a simple ARM firmware.Among them, I'm making a part related to interrupts.I connected the IRQ exception vector in the exception vector table with the interrupt handler in the interrupt controller as follows:
__attribute__ ((interrupt ("IRQ"))) void Irq_Handler(void) { interrupt_handler();}
And it converted to ARM assembly code:
sub lr, lr, #4push {r0, r1, r2, r3, r4, fp, ip, lr}add fp, sp, #28bl 0 <interrupt_hanlder>sub sp, fp, #28ldm sp!, {r0, r1, r2, r3, r4, fp, ip, pc}^
I have several questions for this assembly code:
- Why it pushes registers "r0, r1, r2, r3, r4, fp, ip, lr" to the stack? (2nd line)
- It pushes 8 registers to the stack. But why it subtracts not 32(4*8) but 28(4*7)? (3rd line)
- I don't know the meaning of '^' at the end of 6th line.
Thanks!