Supongo que te estas basando en esta subrrutina:
Codigo:
;*******************************************************************;
; Division : ACCb(16 bits) / ACCa(16 bits) -> ACCb(16 bits) with
; Remainder in ACCc (16 bits)
; (a) Load the Denominator in location ACCaHI & ACCaLO ( 16 bits )
; (b) Load the Numerator in location ACCbHI & ACCbLO ( 16 bits )
; (c) CALL D_div
; (d) The 16 bit result is in location ACCbHI & ACCbLO
; (e) The 16 bit Remainder is in locations ACCcHI & ACCcLO
;
; Performance :
; Program Memory : 037
; Clock Cycles : 310
;
; NOTE :
; The performance specs are for Unsigned arithmetic ( i.e,
; with "SIGNED equ FALSE "
.
;
;
; Program: DBL_DIVS.ASM
; Revision Date:
; 1-13-97 Compatibility with MPASMWIN 1.40
;
;*******************************************************************;
;
ACCaLO equ 10
ACCaHI equ 11
ACCbLO equ 12
ACCbHI equ 13
ACCcLO equ 14
ACCcHI equ 15
ACCdLO equ 16
ACCdHI equ 17
temp equ 18
sign equ 19
;
include "p16c5x.inc"
PIC54 equ 1FFH ; Define Reset Vector
TRUE equ 1
FALSE equ 0
org 0
;*******************************************************************
SIGNED equ FALSE ; Set This To "TRUE" if the routines
; ; for Multiplication & Division needs
; ; to be assembled as Signed Integer
; ; Routines. If "FALSE" the above two
; ; routines ( D_mpy & D_div ) use
; ; unsigned arithmetic.
;*******************************************************************
; Double Precision Divide ( 16/16 -> 16 )
;
; ( ACCb/ACCa -> ACCb with remainder in ACCc ) : 16 bit output
; with Quotiont in ACCb (ACCbHI,ACCbLO) and Remainder in ACCc (ACCcHI,ACCcLO).
;
; NOTE : Before calling this routine, the user should make sure that
; the Numerator(ACCb) is greater than Denominator(ACCa). If
; the case is not true, the user should scale either Numerator
; or Denominator or both such that Numerator is greater than
; the Denominator.
;
;
D_divS
call setup
clrf ACCcHI
clrf ACCcLO
dloop bcf STATUS,C
rlf ACCdLO, F
rlf ACCdHI, F
rlf ACCcLO, F
rlf ACCcHI, F
movf ACCaHI,W
subwf ACCcHI,W ;check if a>c
btfss STATUS,Z
goto nochk
movf ACCaLO,W
subwf ACCcLO,W ;if msb equal then check lsb
nochk btfss STATUS,C ;carry set if c>a
goto nogo
movf ACCaLO,W ;c-a into c
subwf ACCcLO, F
btfss STATUS,C
decf ACCcHI, F
movf ACCaHI,W
subwf ACCcHI, F
bsf STATUS,C ;shift a 1 into b (result)
nogo rlf ACCbLO, F
rlf ACCbHI, F
decfsz temp, F ;loop untill all bits checked
goto dloop
return
;*******************************************************************
;
setup movlw .16 ; for 16 shifts
movwf temp
movf ACCbHI,W ;move ACCb to ACCd
movwf ACCdHI
movf ACCbLO,W
movwf ACCdLO
clrf ACCbHI
clrf ACCbLO
retlw 0
A simple vista se diferencian en muchas cosas. Porque la modificas tanto?
Te aconsejo que la utilices tal y como viene escrita o, si lo prefieres, cambiarle los nombres a los registros, pero nada más. De todas formas te he puesto en rojo la instrucción que creo que te falta.