Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22006

Questions about interrupt handler

$
0
0

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:

  1. Why it pushes registers "r0, r1, r2, r3, r4, fp, ip, lr" to the stack? (2nd line)
  2. It pushes 8 registers to the stack. But why it subtracts not 32(4*8) but 28(4*7)? (3rd line)
  3. I don't know the meaning of '^' at the end of 6th line.

Thanks!


Viewing all articles
Browse latest Browse all 22006

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>