Wireless Scientific wrote: > I'm very tired of placing breakpoints in code after every compile > invocation in MPLAB. (I did this at least 200 times today). > > Is there a way to set up a condition (via assembly code) that forces > the MPLAB/Picmaster to halt execution, basically break? > > That way I can modify code all over the place and my break points > always happen. Craig: Until MPLAB includes the capability to store breakpoint settings by label name rather than by hardwired address, the only way I know is the following: 1. Put the following bit of code somewhere where it will never move... Like between the interrupt vector and the start of your program: BPOINT: NOP RETURN 2. Put the following line near the top of your source file: EN_BRK SET 1 ;1 = ENABLE BREAKPOINTS, ;0 = DISABLE BREAKPOINTS. 3. Add the following macro definition to your source file: BREAK MACRO IF (EN_BRK) CALL BPOINT ENDIF ENDM 4. In your source code, insert the following at every point where you want a breakpoint: BREAK 5. Compile your code, load it into MPLAB, set a breakpoint at "BPOINT", and save the breakpoint settings. Now... If you compile your code with "EN_BRK" set to 1, MPASM will replace every "BREAK" in your program with a "CALL BPOINT". When that CALL is executed in MPLAB, the processor will halt because there's a breakpoint set at the "BPOINT" label. At that point, you can identify which "BREAK" macro just got hit by looking either at the Trace Window (assuming that you've eabled it) or the Stack. When you're done debugging and want to assemble your code without the "CALL BPOINT" instructions, simply set the "EN_BRK" variable to 0 and re-compile. This is nowhere near perfect, of course... I would expect that a much better solution will be forthcoming in future releases of MPLAB. -Andy === Andrew Warren - fastfwd@ix.netcom.com === === Fast Forward Engineering - Vista, California === === === === Did the information in this post help you? Consider === === contributing to the PICLIST Fund. Details are at: === === http://www.geocities.com/SiliconValley/2499/fund.html ===