In SX Microcontrollers, SX/B Compiler and SX-Key Tool, mebikerider wrote: Hi Gunther, Thanks for such a handy utility. I'm using SXSim 2.07 to check the speed of code that I'm hoping to move from user space to ISR space, and it's working great. But... I have code that includes a macro. When I run it in SXSim, the macro is not expanded. When I single-step through the code to execute at the location of the macro, an incorrect instruction is listed, although the code cyclecounts and elapsed time do perform correctly. Is this part of the SXSIM design? I was hoping the macros would be expanded in the resulting code. Is my expectation unrealistic for some reason? I've searched the documentation and haven't seen any mention about how macros are (or aren't) treated. Example code is shown below. In the example, I manually inserted the macro contents in one place to show that SXSim is performing the same cyclecounts for the macro code vs the actual code. David ;----------------------------------------------------------------------- ; send command byte and receive data byte from MAX186 ; Calling code sets "outbyte" to desired value, calls "SendGetByte", ; then receives "inbyte". fastbit macro rl inbyte ; BIT n movb inbyte.0, MAX_DOUT ; movb MAX_DIN, outbyte.7 ; setb MAX_CLK ; we need to shift the outgoing byte after use, rl outbyte ; but lets do it between clocks to give the clock bit clrb MAX_CLK ; that little extra settling time... endm SendGetByte bank52 bank_max186 fastbit ; bit 8 rl inbyte ; bit 7 movb inbyte.0, MAX_DOUT movb MAX_DIN, outbyte.7 setb MAX_CLK rl outbyte clrb MAX_CLK fastbit ; bit 6 fastbit ; bit 5 fastbit ; bit 4 fastbit ; bit 3 ...(and so on...) ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=7&m=53539#m98940 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)