On 5/26/05, Bob Ammerman wrote: > This code has the disadvantage that it is not isochronous -- ie: it doesn't > take the same amount of time for each execution. That may or may not be > important in the OP's application. > > Bob Ammerman > RAm Systems > OK, if you've got stack space (untested code)... this version eliminates the scratch file... ; Be careful where this goes in the program space... mkbitmask: addwf PCL,f retlw b'00000001' retlw b'00000010' retlw b'00000100' retlw b'00001000' retlw b'00010000' retlw b'00100000' retlw b'01000000' retlw b'10000000' set_bit macro ; bit is in 'w' 0..7 call mkbitmask iorwf PORTA,f endm clear_bit macro ; bit is in 'w' 0..7 call mkbitmask xorlw 0xff 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