O'Reilly logo

ARM® Cortex® M4 Cookbook by Dr. Mark Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling interrupts in assembly language

ARM Cortex interrupt handlers can be programmed completely in C, but programmers coding time-critical applications prefer to use assembler (some programmers claim, rather ambitiously, that their hand-crafted assembler programs run up to 30-times faster than compiler generated code, but I suspect that the actual figure is 2-3 times).

When an interrupt (also known as an exception) occurs, the processor responds by performing the following actions:

  • Pushing Registers R0-R3, R12, link register (LR), program counter (PC), and program status (PSR) onto the stack
  • Reading the address of the exception handler from the interrupt vector table
  • Updating the stack pointer, program status, link register, and program counter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required