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 low,w ; W = d.c<br>
andlw 15 ; W = 0.c<br>
addwf high,w ; W = 0.c + a.b<br>
movwf low ; W -> low byte<br>
swapf high,w ; W = b.a<br>
andlw 15 ; W = 0.a<br>
movwf high ; W -> high byte<br>
btfsc status,c ; check carry from add<br>
incf high,f ; 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