3. Debug Macros

# SILENCE

# debug.int - sample macros for debugging interp scripts
#
# DEPTH - show the number of items on the data stack
# CDEPTH- show the function call depth
# LDEPTH- show the loop nesting depth
# TOS   - show a copy of the item on top of the stack in DECIMAL
# xTOS  - show a copy of the item on top of the stack in HEX
# TOP2  - show copies of the top two stack items in DECIMAL
# xTOP2 - show copies of the top two stack items in HEX

#define DEPTH=Sn"Depth=#d\n"
#define CDEPTH=Ir 5K4/ /"CallDepth=#d\n"
#define LDEPTH=Il"LoopDepth=#d\n"
#define TOS=Sc"tos=#d\n"
#define xTOS=Sc"tos=#w\n"
#define TOP2=SCSs"under=#d, top=#d\n"
#define xTOP2=SCSs"under=#w, top=#w\n"

#PROMPT