Hardware Interrupts
4-16
Single Instruction State: This state is entered when you tell the debugger to
execute a single instruction by using RUN 1 or a STEP 1 command. The CPU
executes the single instruction pointed to by PC and then returns to the debug
halt state. If an interrupt occurs in this state and RUN 1 command was used
to enter the state, CPU can service the interrupt. However, if STEP 1 was
used to enter the state, CPU cannot service the interrupt. This is true for both
stop mode and real-time mode.
Note that it is safe to assume that INTM will be respected while single-
stepping. Also, if you single-step the code from the previous example, all of
the uninterruptible, unhaltable code will be executed as "one instruction" as
follows:
PC initially here -> SETC INTM, DBGM
; Uninterruptible, unhaltable region of code
MOV ACC, @Semaphore
SUB ACC, #1 ;Let’s do "*Semaphore--;" really inefficiently!
MOV @Semaphore, ACC
CLRC INTM, DBGM
; Do some more stuff
PC will stop here -> B MAIN_LOOP