;
; Divide W by MpyDiv1
; Return quotient in MpyDiv2
; Return remainder in MpyDiv3
;
Div8x8  movwf   MpyDiv4 ;numerator
        movlw   8
        movwf   Count
        clrf    MpyDiv2 ;quotient
        clrf    MpyDiv3 ;remainder
div1    bcf     STATUS,C
        rlf     MpyDiv4,1
        rlf     MpyDiv3,1
        movf    MpyDiv1,W
        subwf   MpyDiv3,W
        btfsc   STATUS,C
        movwf   MpyDiv3
        rlf     MpyDiv2,1
        decfsz  Count,1
        goto    div1
        retlw   0
        ;
