When using the monitor i would like all ASSERTs to force a break out to the debugger. Is there any way of doing this with some inline C or assembler code? Many Thanks, Martin.
Sure.
All your failed assertions will execution this function. The breakpoint set on it will halt the debugger.
Jon
Thanks for the answer and I will use this if there is no other way but is there any way of achieving this programatically? In VC++ I think you can do something like __asm int3 to force the program to break out to a debugger. Many Thanks, Martin.
Thanks for the answer and I will use this if there is no other way but is there any way of achieving this programatically? Have a look at the instruction set of the '51 and try to find an instruction that acts as a break point. (Hint: There isn't one). In VC++ I think you can do something like __asm int3 to force the program to break out to a debugger. And what makes you think that a '51 will act anything like a PC ?
The monitor 51 has to somehow break out to the debugger, looking at the debug options it uses the serial interrupt. What does it do to the serial port to cause the breakpoint so I can simulate this in my ASSERT? Many Thanks, Martin.
Breakpoints are set in Mon51 by replacing the instruction where you set the breakpoint with an LJMP into the monitor.