Simulating macros

cpedw

Senior Member
When stepping through a program with Macros, the simulator goes directly from the line with a Macro name on to the next line in sequence, not displaying progress through the Macro line by line. Is there a way to alter this behaviour?
 

radiosparks

Member
I have the same issue with macros. My only solution, was to make it a regular subroutine to debug.

Another thing with macros is they can use up a lot of memory, so I try to keep them short and to the point.
 

Flenser

Senior Member
You can generate a version of your program with the macro's expanded using the menu File -> Options, select Diagnostics and enable the Pre-processor option "Display Pre-processor Output".
Then run Check Syntax for your program and PE will open a window which has a copy of your program with the preprocessor directives actioned and the macros expanded. This is the version of the program that the PE "Compile" option will download to the PICAXE chip.
This file is generated in a temp directory with a temp name. Save this file to somewhere you can find it with a name you choose.
Open this saved pre-processor output version of your program and simulate this to see the simulator go through the macro's step by step.
 
Top