It doesn't matter to the compiler if you define TRISB as 0x86 or 0x06 because it cannot fit 8 bits of data into the file register data of the instruction you are using (MOVWF TRISB). Therefore the compiler truncates the value to be 7 bits long. You should then get a message telling you of this. What does make the difference is setting the status,rp0 bit to access the TRIS registers which you appear to have done. However I would do it like this.. movlw 0xFF movwf PORTB movwf PORTA bsf STATUS,5 clrf TRISA clrf TRISB bcf STATUS,5 If your chip is not agreeing with this code then I would suspect that the rest of your code is in error. Did you remember to go back to RAM page 0 after setting the TRIS registers? -- Best regards Tony Multimedia 16F84 Beginners PIC Tools. http://www.picnpoke.com Email picnpoke@cdi.com.au