25.01.2015 Views

Corrections TD2 - exo 3 TD3 - exo 1

Corrections TD2 - exo 3 TD3 - exo 1

Corrections TD2 - exo 3 TD3 - exo 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

; initialisation boucle 2<br />

movlw 0x4<br />

movwf compteur ; initialiser compteur<br />

movlw tab<br />

movwf FSR<br />

boucle2<br />

movf INDF,w<br />

; W somme_pdsfaible<br />

btfsc STATUS,C<br />

; test si pas retenue<br />

incf somme_pdsfort,f ; sinon incremente somme_pdsfort<br />

decfsz compteur , f ; décrémenter compteur et tester sa valeur<br />

goto boucle2<br />

; il faut diviser par 4<br />

bcf STATUS,C<br />

;C W<br />

movWf INDF<br />

;(FSR) W<br />

btfsS STATUS,C<br />

;;;;;;;;;;c=1 si >0 et on saute<br />

GOTO suite<br />

GOTO suite2<br />

suite movf INDF,w<br />

;;;; W

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

Saved successfully!

Ooh no, something went wrong!