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 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#include <stdio.h>
# define nbl 4
int iVal;
int isomme;
int i =0;
char acFormatSaisie[]="%d";
char acTxtSaisie1[]="Entrez le nombre iVal : ";
char acFormatAffichage[]="La somme est egale a : %d ";
void main()
{
_asm
{
mov i,0
debutbcl:
cmp i,nbl
jnb finbcl
push offset acTxtSaisie1
// lea ecx,acTxtSaisie1
// push ecx
call dword ptr printf
add esp,4
push offset iVal
push offset acFormatSaisie
// lea ecx,acFormatSaisie
// push ecx
call dword ptr scanf
add esp,8
mov eax,iVal
mov ebx,isomme
add ebx,eax
mov isomme,ebx
inc i
jmp debutbcl
finbcl:
push isomme
push offset acFormatAffichage
//lea ecx,acFormatAffichage
// push ecx
call dword ptr printf
add esp,8
}scanf("%d",&i);
} |
Partager