At 20:30 27.12.1999 -0600, you wrote: >Hello, > >I just started to learn Pic programming. Can someone comment on my coments >about this program? > >org 0 > >clrf PORTB >bsf STATUS, RP0 >bcf TRISB & 0x07f, 0 ; Set bit 0 to output >Here is where I have trouble. If I understand this correctly, this should >take 00000000 and (and) it >with 01111111. Am I right? What are you trying to do here? Set RB0 as output? Why do need to and register address to $7f ? No need to my nolidge. Simply would need only to do bcf TRISB,0 to set RB0 as output. > >bcf STATUS, RP0 >Goto $ >end >Another thing I want to know is how can you clear PortB if you don't switch >banks first? I mean according to Mykes book, which is where I copied this >program from, the above code says it is ok to clear PortB, but to set the >I/O direction, you need to switch banks first. Thats true. You can always clear portb and porta whitout changing bank. Direction registers how ever are loccated in bank 1 and there fore need to change bank when need to change directions. J.M. Vehasmaa Name: Jurva-Markus Vehasmaa Email: vehasmaa@dlc.fi Homepage: http://www.saunalahti.fi/vehasmaa/ -------------------------- Resist Microsoft monopoly, install Linux challenger.