> subwf RxHold cant the result of this instruction goto w and thus solve the problem of destroying the contents of RxHold Justin -----Original Message----- From: Tony Nixon [mailto:Tony.Nixon@ENG.MONASH.EDU.AU] Sent: Wednesday, 19 December 2001 07:44 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: Need help with 16F877 USART RS232 Tim Webb wrote: Change this block.... > MnLoop > call Receive > > movlw 'A' > subwf RxHold > btfss STATUS, Z > goto no_a > > movlw 01h ; Set RB0 Hi if 'A' Received > movwf PORTB > > movwf TXREG > call TransWt > goto MnLoop > > no_a > movlw 'B' > subwf RxHold > btfss STATUS, Z > goto no_b > > movlw 02h ; Set RB1 Hi if 'B' Received > movwf PORTB > > goto MnLoop > > no_b > goto MnLoop To this.... MnLoop call Receive movlw 'A' xorwf RxHold,W btfss STATUS, Z goto no_a movlw 01h ; Set RB0 Hi if 'A' Received movwf PORTB movwf TXREG call TransWt goto MnLoop no_a movlw 'B' xorwf RxHold,W btfss STATUS, Z goto no_b movlw 02h ; Set RB1 Hi if 'B' Received movwf PORTB goto MnLoop no_b clrf PORTB ; RB0 RB1 = Low goto MnLoop -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics