Do you actually know what it's supposed to do? - It is very generic, with no comments atm.. It looks like it sets up porta and portb as all inputs, and then for some reason sets porta and portb all on. Then it sets bit7 of portb again. Where did you find this? On 7/14/05, Fr10@mweb.co.za 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 > then TRIS Port A&B wich will make them all inputs? > then W is moved to PortA&B - will this drive an input high? > and then again PortB7 is set - what is this function? > > (The option command is obvoisly setting the TMR0 to 1:256 ratio) > > ;***************************************************************** > IO_PIN EQU 007H ;SET INPUT / OUTPUT PIN > ; > IO_MASK = 0FFH & ~(1 << IO_PIN) > > > > ORG 0000H > > GOTO start > > > start MOVLW 0FFH > TRIS PORTA > TRIS PORTB > MOVWF PORTA > MOVWF PORTB > MOVLW 07FH > OPTION > BSF PORTB,RB7 ;RB7 = 0x07 > ;*********************************************************************** > > regards > Francois > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Dave All us base are belong to you. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist