Hi Brian, I'm not sure if I understand your question correctly, but yes, the 'TRIS PORTB' command places whatever is in the 'w' register (0 in this case) into the TRISB register. This register determines whether the corresponding pin in port b will be input (1) or output (0). So by clearing the TRISB register you make all of Port B outputs. After power-up all of port b are inputs (hi impendace) and when you make it output the values on the port are unpredictable, so clr'ing pulls the port low. Just as a note. In the 16F84 datasheet, you will find the both the TRIS and OPTION instructions are only included for upward compatability and they recommend not to use them. The alternative to the code you gave would be the following (with better compatabilty to future and higher end models): start bsf STATUS,RP0 ; Select Bank 1 clrf TRISB ; Make all outputs bcf STATUS,RP0 ; Select bank 0 clrf PORTB ; Pull all pins low Personally I use the TRIS and OPTION instructions and ignore the warnings given by the assembler. Ciao, Graham. Brian Gracia wrote: > Hello Everyone, > > I am new to pics. I was reading tin "Easy Pic n'" and came across some > code. > > start movlw 0x00 > tris portb > clrf portb ;outputs to LO > > If I understand this code correctly it sets all of the pins to output. > Thats fine, then it tells them to go active low. > > If I don't understand it, then when we set portb to outputs, they output > randomly as high and low logic, causing us to do the clrf portb to force > them to active low? > > Which is it? > > Brian