Andy Warren wrote: > A couple of people have already posted lookup-table solutions; if, > for whatever reason, you decide not to use a table, you can save one > instruction per test by doing this: > > MOVF COMND ;Grab the command. > > XORLW VALUE1 ;Test it against the first value. > BZ ROUTINE1 ;Jump if it matches. > ah! you left out the ",w" on the "movf" Andy! Another non-lookup table method which saves an instruction per test over Andy W's method, but limits you to only 8 possible jumps. btfsc COMND,0 ; bitmask to enable routine 1 is goto routine1 ; XXXXXXX1 btfsc COMND,1 ; bitmask to enable routine 2 is goto routine2 ; XXXXXX10 ...and so on. - Andy. --------------------------------------------- Andrew David, Software Manager, Ultronics Ltd. Andy@Ultronics.co.uk ---------------------------------------------