I'm also impressed with the xorlw technique. I just put it in some code where I had to pretty much do a switch-case situation where there are only a few choices and they are not close to each other. A table would've been huge. Harold On Thu, 7 Jun 2001 18:18:56 +1000 Roman Black writes: > Bob Ammerman wrote: > > > > Yes: xorlw method is a bit smaller. > > > > Yes: this method requires at least one word in low half of page. > > > > But: this method is significantly faster. > > > > So: horses for courses. > > > Yep it's a bit quicker, but a lot messier. > The XORLW system you posted is as neat as > a normal table, and can have more units added > to it at any point or subtracted from it. > > Also with a larger table size it would get > significantly smaller (and be MUCH neater). > > All in all I thought your XORLW system was > totally brilliant, only takes 2 words per > table byte and is very neat and simple. > Unless speed is the main issue I think it > would be horse chosen for my course. ;o) > -Roman > > > > > > Bob Ammerman wrote: > > > > > > > > > > I knew it, I knew it... > > > > > > > > > > There _is_ a two instruction per entry technique! > > > > > > > > > > movlw value1^value2^value3 > > > > > decfsz count,F > > > > > xorlw value1 > > > > > decfsz count,F > > > > > xorlw value2 > > > > > decfsz count,F > > > > > xorlw value3 > > > > > etc. > > > > > > > > > > Notice what happens: > > > > > > > > > > If count == 1 on entry then all the xor's except value1 > occur, > > > > > leaving 'value1' in W. > > > > > > > > > > If count == 2 on entry then all the xor's except value2 > occur, > > > > > leaving 'value2' in W. > > > > > > > > > > If count == 3 on entry then all the xor's except value3 > occur, > > > > > leaving 'value3' in W. > > -- > http://www.piclist.com hint: The list server can filter out > subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics