12.07.2015 Views

EK-6 - 320Volt

EK-6 - 320Volt

EK-6 - 320Volt

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317divisionmovfw s_adj ;Read adjustment datasubwf ccpr1l,f ;Capture - adjustbtfsc status,z ;Result = 0 ?goto division2 ;Yes. "R = 0"btfsc status,c ;Result < 0 ?goto division1 ;No. "R > 0"goto division3 ;Yes."R < 0"division1 ;( R > 0 )movlw d'1' ;Set increment valueaddwf p_countl,f ;Increment L countbtfss status,c ;Overflow ?goto division ;No. Continueincf p_counth,f ;Increment H countgoto division ;Jump nextdivision2 ;( R = 0 )movfw ccpr1h ;Read CCPR1Hbtfss status,z ;CCPR1H = 0 ?goto division1 ;No. Nextmovlw d'1' ;Set increment valueaddwf p_countl,f ;Increment L countbtfss status,c ;Overflow ?goto digit_set ;Jump to digit setincf p_counth,f ;Increment H countgoto digit_set ;Jump to digit setdivision3 ;( R < 0 )movfw ccpr1h ;Read CCPR1Hbtfss status,z ;CCPR1H = 0 ?goto division4 ;No. Borrow processgoto digit_set ;Jump to digit setdivision4decf ccpr1h,f ;CCPR1H - 1movlw d'255' ;Borrow valueaddwf ccpr1l,f ;CCPR1L + 255incf ccpr1l,f ;CCPR1L + 1goto division1 ;Next72

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!