On Wed, 15 Aug 2001, wouter van ooijen & floortje hanneman wrote: > > swapf w,0 > > The first argument of swapf must be a file register. W is not a file > register, so this does not work. The assembler will accept it, because w and > f are just symbolic equivalents for the 0 and 1 that are used to specify the > destination. Try "swapf f,0": it will be accepted by the assembler for the > same reason that "swapf w,0" is accepted. Just to be clear, swapf w,0 is equivalent to: swapf INDF,W Since W and INDF are both equ'd to 0. If you want to swap the nibbles in W then you'll need to do something like this: movwf temp swapf temp,W (Unless you're using the 18cxx in which case you can write swapf wreg0,w ) If you want to shift W left 1 space then: movwf temp addwf temp,w ( a rlf will pick up the carry, but otherwise work just as well) Shift left 2: movwf temp addwf temp,f addwf temp,f addwf temp,w Or movwf temp rlf temp,f rlf temp,w andlw 0xfc ;Clear garbage shifted in Scott -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads