Hello Everyone, My previous question seems to have gone astray because it still hasn't appeared on the list after several days. This is good in a way because I have had a chance to do a little more research and now I almost have the answer. The follow piece of code, which I borrowed from an anemometer project and modified to include 16 bit subtraction, is meant to convert a hex number into a decimal format and display the result on a two line LCD display. It almost works. The problem is that I have lost the units value (DestL) by the start of the line that begins with "btfss STATUS,Z". I have tried to save the value after the subtraction to a temporary location but of course that also saves the over-written value as well. I am very much a beginner and have reached my wit's end. Can someone see how I can get this going? Kmail seems to alter the layout of tabbed text so I hope the code is readable when it arrives on the mailing list. init clrf UNITS clrf TENS clrf HUNDREDS movlw 0x10 movwf DestL movlw 0x00 movwf DestH movlw 0x0a movwf SourceL movlw 0x00 movwf SourceH CnvMax movf SourceL,W subwf DestL,1 movf SourceH,W btfss STATUS,C incfsz SourceH,W subwf DestH,1 ;dest = dest - source, WITH VALID CARRY btfss STATUS,Z ; Checks if 10 can be subtracted from ls digit goto PrntMx ; No, so done and go on movwf UNITS incf TENS,F ; Yes, so subtract and inc second digit movlw 10 subwf TENS,W ; Checks if second digit is greater than 10 btfss STATUS,C goto CnvMax movwf TENS incf HUNDREDS,F ; Yes, so subtract and inc third digit goto CnvMax PrntMx end -- Regards, Phil. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.