This only works if the values are sequential, what is not my case. What I mean is to have something like: case 'C' --> goto rot_C case 'X' --> goto rot_X ... Thanks, anyway. regards, Rildo Pragana At 01:11 PM 11/27/96 -0500, you wrote: > Which works well, IF the values are in the range of 0-7. If the > values are more-or-less random, it doesn't work. > > >______________________________ Reply Separator _________________________________ >Subject: Re: switch (case) for the PIC >Author: ray@NETSPACE.NET.AU at internet >Date: 11/27/96 10:27 AM > > >>Does anyone have a simpler switch (multiple case) > > > >The easiest I know of is something like,... > >; enter with value in W. > > ANDLW 0x07 ; constrain to within jump table. > ADDWF PC,F ; add to PC > GOTO CASE_0 > GOTO CASE_1 > GOTO CASE_2 > GOTO CASE_3 > GOTO CASE_4 > GOTO CASE_5 > GOTO CASE_6 > GOTO CASE_7 > ; > ; never get's here > ; > >Ray Gardiner, Shepparton, Victoria, Australia, ray@netspace.net.au >