Merge: doc: fixed some typos and other misc. corrections
[nit.git] / contrib / pep8analysis / tests / privat / 07-matrice.pep
1 ; Semaine 7
2 ; Programme qui lit un matrice 4x3 d'entiers et affiche la transposée
3 ; Jean Privat (c) 2010
4 ;
5 ; Attention, 2 octets par mot.
6          LDX     0,i         
7 in_loop: CPX     24,i        
8          BRGE    afficher    ; for(X=0;X<24;X+=2) {
9          DECI    vecteur,x   ;   vecteur[X] = getInt();
10          ADDX    2,i         
11          BR      in_loop     ; } // fin for
12 afficher:LDX     0,i         
13          STX     ix,d        
14 loop_ix: CPX     8,i         
15          BRGE    fin         ; for(ix=0;ix<8;ix+=2) {
16          LDX     0,i         
17          STX     jx,d        
18 loop_jx: CPX     24,i        
19          BRGE    next_ix     ;   for(jx=0;jx<24;jx+=8) {
20          ADDX    ix,d        
21          DECO    vecteur,x   
22          CHARO   ' ',i       ;     print(vecteur[ix+jx], " ");
23          LDX     jx,d        
24          ADDX    8,i         
25          STX     jx,d        
26          BR      loop_jx     ;   } // fin for jx
27 next_ix: CHARO   '\n',i      ;
28          LDX     ix,d        
29          ADDX    2,i         
30          STX     ix,d        
31          BR      loop_ix     ; } // fin for ix
32 fin:     STOP                ; exit();
33 ; Variables globales
34 vecteur: .BLOCK  24          ; #2d12a vecteur de 10 entiers
35 ix:      .BLOCK  2           ; #2d itérateur ix pour tri
36 jx:      .BLOCK  2           ; #2d itérateur jx pour tri
37          .END