ON 20020813@3:15:59 PM at page: http://www.piclist.com/techref/microchip/math/div/24by16ad.htm jaakko-haakana- added 'Says This code does not work if the divisor is smaller than 0x100. Replace the five instructions at d2416s with the following to make it work (converted for 16f84): movf ACCbHI,W ; divisor hi subwf ACCaHI,w ; remainder hi (w = remainder - divisor) btfss STATUS, C goto d2416ns ; (remainder < divisor), shift in a '0' movf ACCbLO,W subwf ACCaLO,w btfss STATUS,C ' ON 20020813@3:18:22 PM at page: http://www.piclist.com/techref/microchip/math/div/24by16ad.htm jaakko-haakana- added 'Questions:
Let's try again... use this code to fix the routine by replacing five instructions at d2416s: movf ACCbHI,W ; divisor hi subwf ACCaHI,w ; remainder hi (w = remainder - divisor) btfss STATUS, C goto d2416ns ; (remainder < divisor), shift in a '0' movf ACCbLO,W ; divisor lo subwf ACCaLO,w ; remainder lo btfss STATUS,C ;'