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.
Open the
helloISR_c3v0
recipe that we introduced in the Handling interrupts recipe Chapter 3, C Language Programming.Insert a breakpoint adjacent to the first statement of the
UART4_IRQHandler
(that is,IIR = UART4->SR;
).Select Debug → Start/Stop Debug Session from the uVision5 pull-down menu.
Run (F5) to the breakpoint (you will need to select the console window (PuTTY) and enter a character).
uVision5 will now open a Disassembly window (illustrated in the following screenshot), which shows the assembly and machine code generated by the compiler for each C language statement.