D'oh! scewed it up. still untested code follows... ; Be careful where this goes in the program space -- ; the addwf must clear the carry bit... ; Uses one scratch file, named scratch set_bit macro ; bit is in 'w' 0..7 clrf scratch bsf scratch,7 addwf PCL,f rrf scratch,f ; 0100 0000 rrf scratch,f ; 0010 0000 rrf scratch,f ; 0001 0000 rrf scratch,f ; 0000 1000 rrf scratch,f ; 0000 0100 rrf scratch,f ; 0000 0010 rrf scratch,f ; 0000 0001 movfw scratch iorwf PORTA,f endm clear_bit macro ; bit is in 'w' 0..7 clrf scratch bsf scratch,7 addwf PCL,f rrf scratch,f ; 0100 0000 rrf scratch,f ; 0010 0000 rrf scratch,f ; 0001 0000 rrf scratch,f ; 0000 1000 rrf scratch,f ; 0000 0100 rrf scratch,f ; 0000 0010 rrf scratch,f ; 0000 0001 comf scratch,w andwf PORTA,f endm -- You think that it is a secret, but it never has been one. - fortune cookie -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist