I think you need to reread the explanation of subwf. You are subtracting W from a file register (or is it the other way around? i forget. doesn't matter here anyway). movf rcreg,W subwf 'X',w Uses file register #(ASCII code for 'X') and W and does absolutely nothing with rcreg. Try movlw 'X' subwf rcreg,W Then test Z. Olden A (SApS) wrote: > > Hello Everybody, > > I thought that if I took the letter that received (the hex equilanant off > anyway) and then checking the set/clear status of the Z bit, then I could > find out which letter was received, ie. H'42' - H'42' would equal Z bit set. > But that doesn't seem to be happening, can anybody suggest a problem with > that, either logically (ie I'm being stupid) or from the code below. > > Please Help. > Andrew. > > doconverstion > > bcf pir1,rcif ; Here We Clear The Received > Characters Flag, > ; Only because we have to do it > sometime, and > ; to get this far we have to have > received a char. > > movf rcreg,w ; move the received char into the w > register > > subwf 'A',w ; subtract the char received from > the contents > ; if we received a 'A' zero flag of > the status > ; register. If we didn;t then it > should have skipped > > btfsc status,Z > call do_A_Converstion -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads