If you only need 8 different actions based on 8 different bytes you send to PIC you can do something sneaky... Use the BTFSC or BTFSS instructions. You have 8 bits in input and can test each one seperately and do a skip or jump. I must however say that smallest and simplest solution for a decision like this is to asume you get a value in correct range and simply do like this: <- set bank bits to jumptable here before doing any computed jumps... movlw 'A'-1 Get value of smallest possible input - 1 subwf valToTest, W subtract value from input addwf PCL, F add remainder to PCL to do a relative jump goto Acode goto Bcode goto Dcode and so on... Always same speed in decision regardless of input. Quick and dirty :-) KreAture ----- Original Message ----- From: "Jinx" To: Sent: Thursday, January 23, 2003 3:11 AM Subject: Re: [PIC:] NEWBIE - Check To See What Letter Is Being Received from U ART > > No need to reload each time. > > > > This works because: (X xor A) xor (A xor B) > > is the same as: X xor (A xor A) xor B > > which is the same as X xor 0 xor B > > which is the same as X xor B. > > That's quite true. I suggested XORs in the original answer and > put up SUBLW only as an alternative to SUBWF. Reloading > W unnecessarily is inefficient so I commented it > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads