In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: Okay, I'll start asking the questions and you starting answering them. Deal?.... :tongue: In fact, while either syntax works, you're wrong in your assumption. Some registers, like WKPND_B, actually exchange values on what looks like an assignment. In this case what was in WKPND_B ends up in ledBtn and vice-versa. Now, let me ask two serious questions: 1. Did you actually run my code -- unmolested -- to see that it does in fact work? 2. If you answered 'No' to number 1, why should I or anyone else every spend our own time again to help you? I know you're loathe to crack open the SX documentation but if you ever actually do, section 7.2 will explain the exchange of values. I tend to favor syntax that more closely models SX Assembly, hence I use: [code] WKPND_B = ledBits[/code] ... where in assembly (or as compiled by SX/B) it would be: [code] MODE #$09 MOV !RB,ledBtn MOV ledBits, W[/code] The documentation will tell you that W now contains the contents of the WKPND_B register. SX/B takes care of moving W to the variable that was used. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=291549#m291712 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)