Another message accidentally sent to me instead of to the PICLIST... ------- Forwarded Message Follows ------- Date: Thu, 18 Sep 1997 04:51:00 +0400 From: Dmitry Kiryashov To: fastfwd@ix.netcom.com Subject: Re: (Fwd) Re: Bit Number to Bit Mask Question > Hmm... > movlw $01 > btfsc BITNUM,1 > movlw $04 > movwf temp > bcf C > btfsc BITNUM,0 > rlf temp > movf temp,w > btfsc BITNUM,2 > swapf temp,w > > Not terribly encouraging (10 words/10 cycles). Maybe... ; Minimizing ... Final pass . ; movlw $01 btfsc BITNUM,1 movlw $04 movwf temp btfsc BITNUM,0 addwf temp,f btfsc BITNUM,2 swapf temp,f movfw temp ; 9 words / 9 cycles ; > movlw $FF > btfsc BITNUM,0 > andlw $AA > btfsc BITNUM,1 > andlw $CC > btfsc BITNUM,2 > andlw $F0 > movwf temp ; Optimizing ... > comf temp > incf temp > andwf temp,w ; Done . sublw 0 andwf temp,w ; ; 10 words / 10 clocks > Interesting, but even worse (unless I'm missing an optimization on > that ending part). Anyone see any improvements for those two methods > above? The first code looks better . WBR Dmitry . ------ End of Forwarded Message ------- === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499