User`s manual

172 digi.com Using Assembly Language
11.1.2 Embedded C Syntax
A C statement may be placed within assembly code by placing a ā€œcā€ in column 1. Note that the registers
used in the embedded C statement will be changed.
11.1.3 Setting Breakpoints in Assembly
There are two ways to enable software breakpoint support in assembly code.
One way is to explicitly mark the assembly block as debug (the default condition is nodebug). This
causes the insertion of RST 0x28 instructions between each assembly instruction. These RST 0x28
instructions may cause jump relative (i.e., jr) instructions to go out of range, but this problem can be
solved by changing the relative jump (jr) to an absolute jump (jp). Below is an example.
#asm debug
function::
...
ret
#endasm
The other way to enable breakpoint support in a block of assembly code is to add a C statement before the
desired assembly instruction. Note that the assembly code must be contained in a debug C function to
enable C code debugging. Below is an example.
debug dummyfunction() {
#asm
function::
...
label:
...
c ; // add line of C code to permit a breakpoint before jump relative
jr nc, label
ret
#endasm
}
Note: Single stepping through assembly code is always allowed if the assembly window is
open.
#asm
InitValues::
c start_time = 0;
c counter = 256;
ret
#endasm