int i 10 int a 10301248 int s 0 for i 0 i 0 s ai conver

int i = 10;

int a[] = {10,-30,-12,4,8};

int s = 0;

for (i = 0; i<5; i++)

if (a[i] > 0)

s += a[i];

convert c language to assembly

Solution

I have complited the above source to generate assembly code using GNU C compiler. I have added few libraries in the code for compilation. I have copied the code in file name : test.c. And compiled using the command :

gcc -std=c99 -c -Wa,-ald -g test.c

The generated assembly code is:

int i = 10; int a[] = {10,-30,-12,4,8}; int s = 0; for (i = 0; i<5; i++) if (a[i] > 0) s += a[i]; convert c language to assemblySolutionI have complited t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site