In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Here is a way to do it without needing the tempByte variable. [code] idx VAR Byte OUTPUT RB ' Make all bits of RB outputs idx = 1 DO RB = RB OR idx idx = idx << 1 LOOP UNTIL idx = 0 ' 128 << 1 = 0 for byte variables Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=138451#m140541 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)