I am creating a general macro for sending messages to an LCD display, and have run into a problem. Here's my code: clrf counter disloop incf counter,1 ;get next character position from table movf counter,0 ;put char position into W call mess2 ;get the character movwf datalines ;send it to lcd ; housekeeping for LCD snipped comf datalines,0 ;end of table has 0xff marker, so I complement it and check for zero btfsc status, z ;complemented character = 0? goto exitaddr ;yes, done goto disloop ;no, not done, get next character. exitaddr ;continue on mess2 addwf pc,1 retlw 'H' retlw 'I' retlw 0xff The code does not take the branch to exit. As I read the spec sheet, the comf command should set the z flag if the result is zero (ie, datalines contained 0xff before the comf command). What am I doing wrong? -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads