Merge: doc: fixed some typos and other misc. corrections
[nit.git] / contrib / pep8analysis / tests / privat / 06-sommes2.pep
1 ; Semaine 6
2 ; Programme calcule et compare deux sommes
3 ; Version sans sous-programme + pseudo-boucle (variable étape)
4 ; Jean Privat (C) 2010
5 debut:   STRO    msgNum1,d   ; do {
6          DECI    num,d       
7          LDA     num,d       
8          STRO    msgNum2,d   
9          DECI    num,d       
10          ADDA    num,d       
11          STA     num,d       
12          STRO    msgSomme,d  
13          DECO    num,d       
14          CHARO   '\n',i      ;   Lecture, calcul et affichage somme 1
15          LDA     etape,d     ;   if (etape == 0) {
16          BRNE    fin         
17          STA     sum1,d      ;     sauvegarde somme 1;
18          LDA     1,i         
19          STA     etape,d     ;     etape = 1; }
20          BR      debut       ; } while(etape==0);
21 fin:     CPA     sum1,d      ; if (somme2>somme1) {
22          BRGT    plus        
23          STOP                
24 plus:    STRO    msgPlus,d   ;   print ... }
25          STOP                ; exit;
26 num:     .BLOCK  2           ; #2d
27 sum1:    .BLOCK  2           ; #2d
28 etape:   .BLOCK  2           ; #2d 0=on calcule la premier somme, 1=on cacule la 2eme somme
29 msgNum1: .ASCII  "Entrez un nombre : \x00"
30 msgNum2: .ASCII  "Entrez un autre nombre : \x00"
31 msgSomme:.ASCII  "Leur somme est : \x00"
32 msgPlus: .ASCII  "Celle-ci est plus grande.\x00"
33          .END