te pongo el codigo para que lo examines
// Clear the remainder
clrf __REMB0, 0
clrf __REMB1, 0
clrf __REMB2, 0
// Set the counter to 24
movlw 24
movwf INDF1, 0
// Clear the carry flag
bcf STATUS, 0, 0
loop:
//AARG24 <<= 1; The carry is always clear at the top of the loop.
rlcf __AARGB2, 1, 0
rlcf __AARGB1, 1, 0
rlcf __AARGB0, 1, 0
// REM24 = (REM24 << 1) | (AARG24 >> 24)
rlcf __REMB2, 1, 0
rlcf __REMB1, 1, 0
rlcf __REMB0, 1, 0
//if (PROD >= BARG24)
movf __BARGB2, 0, 0
subwf __REMB2, 0, 0
movf __BARGB1, 0, 0
subwfb __REMB1, 0, 0
movf __BARGB0, 0, 0
subwfb __REMB0, 0, 0
bnc _false
//{
//REM24-= BARG24;
movf __BARGB2, 0, 0
subwf __REMB2, 1, 0
movf __BARGB1, 0, 0
subwfb __REMB1, 1, 0
movf __BARGB0, 0, 0
subwfb __REMB0, 1, 0
incf __AARGB2, 1, 0
//}
_false:
decfsz INDF1, 1, 0 // if (--count != 0) then loop. Does not affect carry flag.
bra loop