May 18, 1992 USING THE DEBUG DIRECTIVE: NOTE: This directive really stretches the limits of the Downloader hardware and may not always work. However, when it does operate, it can be very useful. If you have the PIC Downloader, there is a directive you can use to read back register contents and I/O pins while your program runs. This directive, called "DEBUG", is inserted in your source file. DEBUG has no parameters and may only be inserted in your program once (if you need to monitor registers at various points in your program, include the DEBUG directive in a subroutine which can be called as necessary). When DEBUG is encountered in your program, the Downloader will send register contents (except 08h-0Fh) and I/O pins back to the PC. The PC will display a special screen for this data. From the PC, you can press to halt your program when it passes through DEBUG; pressing again allows your program to continue running until it reaches DEBUG again. To resume normal operation, press . The DEBUG directive does use some resources for its work, as shown below: 1) 8 words at the point of insertion 2) 69 words at the end of program memory 3) Contents of registers 08h-0Fh are destroyed BEFORE being sent to the PC (the PC displays question marks for these registers).