XC2200 Derivatives
System Units (Vol. 1 of 2)
Debug System
User’s Manual
11-7
V2.1, 2008-08
OCDS_X8, V2.4
SBRK Instruction
This is a mechanism through which the software can explicitly generate a debug event.
It can be used for instance by a debugger to temporarily patch code held in RAM in order
to implement
Software Breakpoints
.
A special SBRK (Software BReaK) instruction is defined with opcode 0x8C00. When this
instruction has been decoded and it reaches the Execute stage, the whole pipeline is
canceled including the SBRK itself. Hence in fact the SBRK instruction is never
“executed” by itself.
The further behavior is dependent on how OCDS has been programmed:
• if the OCDS is enabled and the software breakpoints are also enabled, then the CPU
goes into
Halt Mode
• if the OCDS is disabled or the software breakpoints are disabled, then the Software
Break Trap (SBRKTRAP) is executed-Class A Trap, number 08
H
Break Pin Input
An external debug break pin (BRKIN) is provided to allow the debugger to
asynchronously interrupt the processor.