In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: Or this.... this only works if it's two adjacent bits (or bits with same index).... [code] ' compare myByte.0 and myByte.1 MOV W, >>myByte ' get bit1 into bit0 in W XOR W, myByte ' now XOR with orig. bit0 in myByte; if they are different, bit0 = 1 AND W, #%0000_0001 ' but mask off the other irrelevant bits in W JZ :notdifferent ' if 0, they are same as last time :different 'do something JMP :done :notdifferent ' do something :done [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=331284#m331299 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)