Frank Dalton wrote: > Using a PIC, has anybody figured out a good > way to take a number from zero to seven (0 to 7) > and use it to generate the corresponding bit > mask (i.e., 00000001, 00000010, 00000100, etc.)? A look-up table is certainly (probably?) the fastest. Here's a short looped version that doesn't trash W: CLRF result INCF count,F SETC RLF result,F DECFSZ count,F goto $-2 Execution time is (7 + 4*count) cycles. Scott