The LazyBoy Library Manual - Debug Macros

The Debug macros provide a simple method to assist in debugging a program. These macros generate no code in the compiled binary unless DEBUG is defined.

The macros can be used at any point within a program (after initialization) regardless of any register state. They will perform their function and return without modifying the any registers or flags. Mostly, they are simply of variants calls to the text Writer that preserve flags and insure the proper data segment. There usage should be fairly self explanatory.

When DEBUG is defined, the first use of any of the debug macros will attempt to append the DEBUG.TXT file in the current working directory and will send all debugging messages to that file. If the file does not exist, it will be created. If the can not be opened or created, debug messages will be directed to StdOut. If the messages are directed to a file, that file will be closed automatically by the terminate macro.

Enabling debugging can add roughly 2kb of code to a program. Since the debugging macros utilize other parts of the library, the exact amount of additional code required to support the macros will decrease some as the program becomes more complex.


DebugWrite 0-*Output information for debugging.
DebugWriteLn 0-*Output information followed by a CR/LF for debugging.
DebugRegisters 0  Output the current register states for debugging.
DebugFlags 0Output the current flag states for debugging.
 
DebugMsg 0-*Output the current address and a message followed by a CR/LF for debugging.
DebugInfo 0Output the current address, register states and flags for debugging.
DebugStack 0-1Output the current address and values on stack for debugging. If a parameter is provided, it will display up to that many words from that stack. The default is up to 36 words.