ON 20070911@4:50:48 PM at page: http://www.piclist.com/techref/microchip/math/div/16byconst15-dk.htm#39336.7019328704 [yesiamwds-netscape-Q5A] Code:
Here is a 9 instruction version of Dmitry's code:<br><br>
      swapf &nbsp;  low,w  &nbsp;&nbsp;    ; W =  d.c<br>
      andlw &nbsp;  15   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     ; W =  0.c<br>
      addwf &nbsp;  high,w  &nbsp;   ; W =  0.c + a.b<br>
      movwf &nbsp;  low  &nbsp;&nbsp;&nbsp;&nbsp;      ; W -> low byte<br>
      swapf &nbsp;  high,w &nbsp;    ; W =  b.a<br>
      andlw &nbsp;  15  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       ; W =  0.a<br>
      movwf &nbsp;  high  &nbsp;&nbsp;&nbsp;     ; W -> high byte<br>
      btfsc &nbsp;  status,c   ; check carry from add<br>
      incf &nbsp;&nbsp;   high,f  &nbsp;   ; 0.a + carry
ON 20070911@4:59:23 PM at page: http://www.piclist.com/techref/microchip/math/div/16byconst15-dk.htm# James Newton[JMN-EFP-786] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\microchip\math\div\16byconst15-dk.htm&version=3