Hello Olin, Harold et all, I've been studing (mmm, is this conjugation correct?) the Bob's code at http://www.piclist.com/techref/microchip/18c/ongoto-ba.htm and adapted it to my situation: // COMPUTED GOTO #asm rlncf state, W_ // put state*2 movwf gotoarg // in gotoarg rcall comp_goto // This is the trick, comp_goto deals with TOSL and TOSH goto case00 // then returns to the correct "goto caseXX" goto case01 goto case02 goto case03 comp_goto: rlncf gotoarg, W_ // add gotoarg*2 addwf TOSL,F // on TOSL movlw 0 addwfc TOSH,F // if carry, increments TOSH return // returns directly to the "goto caseXX" #endasm It's not very efficient. My "brute-force" method uses 8 instruction and Bob's method uses 14, but it works. Bob's code have 16-bit limit, my implementation is 7-bit (128 gotos possible). Now I'll try to optimize it. Best regards, Brusque ----------------------------------------------------------------- Edson Brusque C.I.Tronics Lighting Designers Ltda Research and Development Blumenau - SC - Brazil Say NO to HTML mail www.citronics.com.br ----------------------------------------------------------------- -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body