1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| typedef struct tabReg // structure
{
char nom[4] ;
int valeur ;
} tabReg;
// header de la fonction affichage
void affichage1(int a,int reg,tabReg );
// l'implementation de cette fonction
void affichage1(int a,int reg,tabReg tab[] )
{
switch (a)
{
case 0 :
printf("%s,[bx + si ]",tab[reg].nom);
break ;
case 1 :
printf("%s,[bx + di ]",tab[reg].nom);
break ;
case 2 :
printf("%s,[bp + si ]",tab[reg].nom);
break ;
case 3 :
printf("%s,[bp + di ]",tab[reg].nom);
break ;
case 4 :
printf("%s,[ si ]",tab[reg].nom);
break ;
case 5 :
printf("%s,[ di ]",tab[reg].nom);
break ;
case 6 :
printf("%s,",tab[reg].nom);
break ;
case 7 :
printf("%s,[ bx ]",tab[reg].nom);
break ;
}
} |
Partager