Pagini recente » Cod sursa (job #1047953) | Cod sursa (job #2323824) | Cod sursa (job #2789658) | Cod sursa (job #471047) | Cod sursa (job #870575)
Cod sursa(job #870575)
/*
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
return 0;
}
*/
#include<stdio.h>
int main(){
freopen("adunare.in","r",stdin);
freopen("adunare.out","w",stdout);
int a,b,j;
char format1[]={"%d%d"};
char format2[]={"%d\n"};
asm("push %%eax;"
"push %%ebx;"
"push %%ecx;"
"call scanf;"
"pop %%ecx;"
"pop %%ebx;"
"pop %%eax;"
:"=a"(j)
:"a"(&b),"b"(&a),"c"(format1));
asm("addl %%ebx,%%eax;"
:"=a"(a)
:"a"(a),"b"(b));
asm("push %%eax;"
"push %%ebx;"
"call printf;"
"pop %%ebx;"
"pop %%eax;"
:"=a"(j)
:"a"(a),"b"(format2));
return 0;
}
//Sper sa mearga assemblerul pe infoarena :D