#include <stdio.h>
int x = 0, y = 0, z = 0;
void cv_2_1_1() {
scanf("%d %d", &x, &y);
asm(".intel_syntax noprefix \n"
"mov eax, x \n"
"mov ecx, y \n"
"add eax, ecx \n"
"mov z, eax \n"
".att_syntax \n");
printf("%d\n\n", z);
}
void cv_2_1_2() {
scanf("%d", &x);
asm(".intel_syntax noprefix \n"
"mov eax, x \n"
"shl eax, 1 \n"
"mov z,eax \n"
".att_syntax \n");
printf("%d", z);
}
void cv_2_1_3() {
scanf("%d", x);
asm(".intel_syntax noprefix \n"
"mov eax, x \n"
"cmp ecx, 9 \n"
"jnle gamma \n"
"add eax, -7 \n"
"gamma:\n"
"add eax, 55 \n"
"mov z, eax \n"
".att_syntax \n");
printf("%d - %c", z, z);
}
int main() {
printf("Zadajte 2 hodnoty: \n");
cv_2_1_1();
printf("Zadajte hodnotu: \n");
cv_2_1_2();
printf("Zadajte hodnotu: \n");
cv_2_1_3();
return 0;
}
So this is the code ive been trying to use, my friend uses the same platform to write down the code and it runs for him just fine. Does anyone know what the problem might be or what is causing the issue ? I tried the same code in Codeblocks and it gave me an undefined reference to x undefined reference to y undefined reference to z error messages. Thanks in advance.