In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Like Peter said, after reset or wake-up the SX starts executing from the beginning again. NOT at the instruction after SLEEP. "MOV !RB,W" will always swap the values. There is no such instruction as "MOV !RB,#0" or "MOV !RB,someVar", they are compound instructions. So "MOV !RB,#0" becomes "MOV W,#0" & "MOV !RB,W" And "MOV !RB,someVar" becomes "MOV W,someVar" & "MOV !RB,W", so no the WKPND values does NOT end up in someVar unless you do "MOV !RB,someVar", then "MOV someVar,W" You have to watch those compound instructions, they are handy, but they can really trip you up. Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=228579#m228625 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)