Debugging assembly language

We can gain a useful insight into how assembly language instructions execute, and also why the compiler is rather poor at translating C using the debugger.

First, we'll compare a fragment of assembly language code produced by the compiler with our translation.

How to do it…

  1. Open the helloISR_c3v0 recipe that we introduced in the Handling interrupts recipe Chapter 3, C Language Programming.
  2. Insert a breakpoint adjacent to the first statement of the UART4_IRQHandler (that is, IIR = UART4->SR;).
  3. Select DebugStart/Stop Debug Session from the uVision5 pull-down menu.
  4. Run (F5) to the breakpoint (you will need to select the console window (PuTTY) and enter a character).
  5. uVision5 will now open a Disassembly window (illustrated ...

Get ARM® Cortex® M4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.