Francois Robbertze wrote: > I found the following in a asm file for a 16f84a > Can someone tell met what is the function of the > IO_MASK=0FFH &~(1< I have trouble understanding the port setup > first 0xFF is moved to W Correct. > then TRIS Port A&B wich will make them all inputs? Correct. > then W is moved to PortA&B - will this drive an input high? No, but it will pre-load the port output latches with 1's so that if/when the pins ARE made outputs by the firmware, they'll drive high. It appears from the IO_MASK comment that IO_PIN is used as both input and output, so this makes sense. > and then again PortB7 is set - what is this function? It's redundant, probably either left over from earlier editing of the source code or maybe the start of whatever the software is doing with IO_PIN. > (The option command is obvoisly setting the TMR0 to 1:256 > ratio) Well, no... It's assigning the prescaler to the WDT and setting it to 1:128. It also (probably more importantly) turns on the PORTB weak pullups. Read the datasheet; these details are important. -Andy === Andrew Warren - fastfwd@ix.netcom.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist