30tempo_50msmovlw d50 31movwf cmpt_50ms 32loop_50mscall tempo_1ms 33decfsz cmpt_50ms,f 34goto...
TRANSCRIPT
![Page 1: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/1.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC PilePC
21
Utilisation et gestion
du compteur de programmeProgram Counter (PC)
et de la pile (Stack)
• Lors du déroulement d’un programme
• Lors de l’appel d’un sous-programme
• Lors d’une interruption
![Page 2: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/2.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC PilePC
22
![Page 3: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/3.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
23
PilePC
30
Pile
23
![Page 4: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/4.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC Pile
23
PC
31
![Page 5: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/5.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
32
Pile
23
![Page 6: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/6.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
33
Pile
23
PC
40
Pile
33
23
![Page 7: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/7.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
41
Pile
33
23
![Page 8: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/8.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
42
Pile
33
23
![Page 9: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/9.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
43
Pile
33
23
![Page 10: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/10.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
44
Pile
33
23
![Page 11: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/11.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
45
Pile
33
23
PC
42
![Page 12: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/12.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
43
Pile
33
23
![Page 13: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/13.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
44
Pile
33
23
PC
45
![Page 14: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/14.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
46
Pile
33
23
PC
33
Pile
23
![Page 15: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/15.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
34
Pile
23
PC
35
![Page 16: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/16.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
36
Pile
23
PC
23
Pile
![Page 17: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/17.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
24
PilePC
25
![Page 18: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/18.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
26
Pile
![Page 19: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/19.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
27
Pile
![Page 20: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/20.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
PC
28
Pile
![Page 21: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/21.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
avec interruptions
04 bsf L_ALARME
05 call Tempo_3s
06 bcf L_ALARME
07 retfie
Interruptions
PC
41
Pile
33
23
PC
04
Pile
41
33
23
![Page 22: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/22.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 bsf L_ALARME
05 call Tempo_3s
06 bcf L_ALARME
07 retfie
Interruptions
PC
05
Pile
41
33
23
avec interruptions
![Page 23: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/23.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 bsf L_ALARME
05 call Tempo_3s
06 bcf L_ALARME
07 retfie
Interruptions
PC
06
Pile
41
33
23
PC
50
Pile
06
41
33
23
avec interruptions
![Page 24: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/24.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 bsf L_ALARME
05 call Tempo_3s
06 bcf L_ALARME
07 retfie
Interruptions
PC
06
Pile
41
33
23
PC
50
Pile
06
41
33
23
avec interruptions
![Page 25: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/25.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 bsf L_ALARME
05 call Tempo_3s
06 bcf L_ALARME
07 retfie
Interruptions
PC
07
Pile
41
33
23
avec interruptions
![Page 26: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/26.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 bsf L_ALARME
05 call Tempo_3s
06 bcf L_ALARME
07 retfie
Interruptions
PC
08
Pile
41
33
23
Pile
33
23
PC
41
avec interruptions
![Page 27: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/27.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 bsf L_ALARME
05 call Tempo_3s
06 bcf L_ALARME
07 retfie
Interruptions
PC
42
Pile
33
23
avec interruptions
![Page 28: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/28.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 movwf W_temp
05 swapf STATUS,w
06 bcf STATUS,RP0
07 movwf Satus_temp
08 bsf L_ALARME
09 call Tempo_3s
10 bcf L_ALARME
11 swapf Status_temp,w
12 movwf STATUS
13 swapf W_temp,f
14 swapf W_temp,w
15 retfie
InterruptionsSauvegardedu contexte
Restitutiondu contexte
avec interruptions
PilePC
![Page 29: 30Tempo_50msmovlw d50 31movwf Cmpt_50ms 32Loop_50mscall Tempo_1ms 33decfsz Cmpt_50ms,f 34goto Loop_50ms 35return 20movlw d10 21movwf Compteur 22Attendcall](https://reader038.vdocument.in/reader038/viewer/2022110305/551d9d90497959293b8c5b06/html5/thumbnails/29.jpg)
30 Tempo_50ms movlw d’50’
31 movwf Cmpt_50ms
32 Loop_50ms call Tempo_1ms
33 decfsz Cmpt_50ms,f
34 goto Loop_50ms
35 return
20 movlw d’10’
21 movwf Compteur
22 Attend call Tempo_50ms
23 decfsz Compteur,f
24 goto Attend
25 movf Consigne,w
26 sublw d’5’
27 btfsc STATUS,Z
28 goto Alarme
40 Tempo_1ms movlw d’249’
41 movwf Cmpt_1ms
42 Loop_1ms nop
43 decfsz Cmpt_1ms,f
44 goto Loop_1ms
45 return
Appels de sous-programmes
Programme principal Sous-programmes
EPAI Fribourg / Hervé Page
04 movwf W_temp
05 swapf STATUS,w
06 bcf STATUS,RP0
07 movwf Satus_temp
08 call Int_rb0
09 swapf Status_temp,w
10 movwf STATUS
11 swapf W_temp,f
12 swapf W_temp,w
13 retfie
Interruptions
avec interruptions
PilePC