----- Original Message ----- From: "Daryl Sayers" To: Sent: Monday, January 14, 2002 6:49 PM Subject: Beginners 16C84 programming question > I had a play with a 16C84 several years ago and I now need to make it do > something. I am a real PIC beginner. My simple programming question is how do > I represent a byte out to the RB port. It seems my restriction is using a > variable in the bsf op code. I manually did it by doing each bit but I am > sure there is a more elegant way of doing it through a loop. > I am using gpasm-0.9.14 alpha to assemble code. > > movlw 0x01 > subwf TmpByte,w > btfsc STATUS, Z > bsf PORTB,0 > > movlw 0x02 > subwf TmpByte,w > btfsc STATUS, Z > bsf PORTB,1 > > ...... > > movlw 0x80 > subwf TmpByte,w > btfsc STATUS, Z > bsf PORTB,7 > You sure are taking the long way around! Why not just: movf TmpByte,W movwf PORTB ? In your code you also fail to reset the port pin if STATUS,Z is 0... /\/\/\/*=Martin -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body