In SX Microcontrollers, SX/B Compiler and SX-Key Tool, VelocitąPaola wrote: It sounds like you need an array of bits... as far as I know, that's not available in SX/B and there's no direct way to do it in ASM either (though I'm by no means an ASM expert). I would use a byte as an array, and each bit as a separate iteration. Something like this: [code] CHK_DM_CLS SUB 1 [/code] [code] CHK_DM_CLS state '"state" is a byte variable... [/code] [code] SUB CHK_DM_CLS 'Where state.0, state.1, and state.2 are the parameters 'You can also clone the state of a set of input pins to state by 'doing this: state = RB, or you can substitute RB for state altogether tmp1 = __PARAM1 FOR index = 0 TO 2 IF tmp1.0 = 1 THEN 'Close dome ENDIF tmp1 >> 1 NEXT ENDSUB [/code] This subroutine closes the dome if [i]any[/i] of the state are "on." It shifts through each bit since you can't use a variable as a bitIndex. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=268167#m268218 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)