At 09:01 PM 6/18/2004 -0700, Dave Hylands wrote: >I think that the fastest way is to have a sixteen entry lookup table, >where the answer is precomputed and stored. > >You could also store a 16 bit value, where each bit position holds the >answer and use something like (in C): > >Lookup & ( 1 << val ) Yes, that was my first take. In avr assembler: clr TEMP2 ldi ZL,low(Xor_Table*2) ldi ZH,high(Xor_Table*2) add ZL,XOR_Dat adc ZH,TEMP2 lpm I suppose this isn't all that ugly. What's this anyway, two PIC instructions worth? I just get the feeling there's a better way.
Message
RE: [AVR-Chat] Exclusive or
2004-06-19 by David VanHorn