In SX Microcontrollers, SX/B Compiler and SX-Key Tool, devincox wrote: I have a question about a code snippet from the ADC example in Guenther's book mentioned above. mov w, >>rc ;read current state of adc's not w ;turn inputs to outputs and w, #%01010000 ;mask adc1 and adc0 or port_buff, w ;save new value in buffer mov rc, port_buff ;refresh charge/discharge lines I understand what the mov commands are doing and how the logical operations affect various bytes/registers, but I can't figure out why it is done this way. Perhaps I am overlooking something extremely basic, but I am still learning, so it's escaping me. Could someone go into some detail on the code above? The input and output bits are staggered so that when the mov w, >>rc line occurs it shifts the input bits into the location where the output bits were located. Then the next command flips everthing....? I indented the code/comments but when I posted it removed the formatting. sorry. Thanks in advance, Devin ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=341240#m344121 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)