In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: Your logic is flawed. You JUMP while in your for/next code, which is a subroutine. Since the the two jump locations are also subs, when they finish, the RETURN is really for the FIRST sub called -- NIDEK. You should probably change the the jumps to GOSUB (or CALL @ in ASM), e.g. [code] SUB NIDEK_CODE HIGH LED ASM CLC ENDASM FOR idx =1 to 9 ASM RR NIDEKCODE JC @GoSu_OutOne ' JMP OUTZERO now not needed as outzero follows ENDASM GoSu_OutZero: OUTZERO GOTO FNdone GoSu_OutOne: OUTONE FNdone: NEXT ENDSUB [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=369403#m369406 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)