In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cutsing wrote: Hi, I seem to be here a lot today.. I have an interesting problem and it appears to be a compiler issue. I have the code: ReadSwitches: Switches = SInp \ NOP Switches = ~Switches \ nop Return Which compiles to: ReadSwitches: MOV FSR,#Switches ; Switches = SInp MOV IND,SInp MOV FSR,#$10 NOP ;\ NOP MOV FSR,#Switches ; Switches = ~Switches MOV W,/IND MOV __PARAM2,W MOV FSR,#$10 NOT __PARAM2 MOV FSR, #Switches MOV IND,__PARAM2 MOV FSR,#$10 NOP ; \ nop The problem is that the MOV W,/IND inverts the bits then the NOT __PARAM2,W does it again returning switches to the original state. I have used this successfully with switches in the Base page but when switches is at address $20 it does not work. Anyone got a clue? Thad ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=156272 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)