Dave Birchall posted a hex-to-ASCII routine that I wrote and asked about my use of the BNC pseudo-op. Mike Ghormley replied: > BNC is a pseudo-op which stands for Branch on Not Carry. It will > branch the code to a LABEL if the Carry Flag is NOT set. Correct. > IMHO the code that you posted doesn't work. It would loop forever. Incorrect. > I have added code that I believe will do the job. I have denoted > my code additions it by placing "@@@" in the expanded comments. > > ;@@@ equates for the destination register for operations so that we > ;@@@ can use code such as: > ;@@@ SUBWF REGISTER,w > ;@@@ or > ;@@@ ADDWF REGISTER,f > w EQU 0 ;@@@ destination is the working reg > f EQU 1 ;@@@ destination is the file reg This is unnecessary; any assembler that understands the "BNC" pseudo-op also understands the "w" and "f" destination-specifiers without any need for them to be explicitly defined. Furthermore, the "improvements" you made to my code do nothing but make the code slower and larger. For the sake of readability and brevity, I'll show just one portion of your version without the lengthy comments, rather than quoting the whole thing verbatim: Michael's version: ------------------ > DO100S MOVLW d'100' > SUBWF ASCIIO,w > BNC DO10S > > INCF ASCIIH,f > > MOVLW d'100' > SUBWF ASCIIO,f > GOTO DO100S My original code: ----------------- DO100S MOVLW 100 SUBWF ASCIIO,W BNC DO10S MOVWF ASCIIO INCF ASCIIH GOTO DO100S Ok... If you look closely at my code, you'll see that after the BNC instruction, the W register ALREADY contains ASCII0-100; there's NO NEED to load W with 100 and do the subtraction again. That is, contrary to the comments you wrote for my code, the result of the subtraction IS used. -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering, Vista, California === http://www.geocities.com/SiliconValley/2499