__setSimBreak
Syntax
__setSimBreak(location, access, action)
Parameters
locationA string that defines the data location of the breakpoint, either a valid C-SPY expression whose value evaluates to a valid address or an absolute location. For information about the location types, see Enter Location dialog box.
accessThe memory access type:
"R"for read or"W"for write.
actionAn expression, typically a call to a macro, which is evaluated when the breakpoint is detected.
Return value
Result | Value |
|---|---|
Successful | An unsigned integer uniquely identifying the breakpoint. This value must be used to clear the breakpoint. |
Unsuccessful |
|
For use with
The C-SPY simulator.
Description
Use this system macro to set immediate breakpoints, which will halt instruction execution only temporarily. This allows a C-SPY macro function to be called when the processor is about to read data from a location or immediately after it has written data. Instruction execution will resume after the action.
This type of breakpoint is useful for simulating memory-mapped devices of various kinds (for instance serial ports and timers). When the processor reads at a memory-mapped location, a C-SPY macro function can intervene and supply the appropriate data. Conversely, when the processor writes to a memory-mapped location, a C-SPY macro function can act on the value that was written.