In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote: Hi all! MODE $09 MOV !RB, rbStatus MOV rbStatus, W may still look mysterious to some readers, wondering about how W gets the correct value. So it is important to note that MOV !RB, rbStatus is a multi-word instruction. When SASM generates the instruction code, it actually generates the following sequene: MODE $09 W, rbStatus ; replacement for MOV !RB, W ; MOV !RB, rbStatus MOV rbStatus, W As Jon mentioned, the MOW !RB, W does not just copy W into !RB but it exchanges the contents of both registers. So W will hold the status of the WKPND_B bits after this exchange. Provided that rbStatus is cleared before, all WKPND_B bits will be reset after the exchange. Please note that this is very important. When the bits are not all cleared, another interrupt will be fired immediately after leaving the ISR with a RETI, or RETIW instruction. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=92178#m92607 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)