Hi All! There are some more trick(idea). .... SUBWF REG,W SUBWF REG,F ADDWF REG,W .... the code sequency above may be used to exchange W with some REG(s) at one time with comparision greater_or_equal or so. For example: SUBWF REG0,W ;REG0(old)-W SKPC ;REG0(old)>=W GOTO LABEL1 SUBWF REG0,W ;restore i.e. REG0-(REG0-W)=W SUBWF REG1,W SKPC ;REG1>=W GOTO LABEL2 SUBWF REG1,W ;restore W ..... LABEL1: SUBWF REG0,F ;REG0(new)=REG0(old)-(REG0(old)-W)=W ADDWF REG0,W ;W=REG0(new)+(REG0(old)-W)=REG0(old) .... LABEL2: SUBWF REG1,F ;=W ADDWF REG1,W ;=REG1(old) .... WBR Dmitry.