given the assembly language fill in the blanks for the C code. pushl %ebp movl %
ID: 3624052 • Letter: G
Question
given the assembly language fill in the blanks for the C code.pushl %ebp
movl %esp,%ebp
pushl %esi
pushl %ebx
movl 8(%ebp),%ebx
movl 12(%ebp),%esi
xorl %edx,%edx
xorl %ecx,%ecx
cmpl %ebx,%edx
jge .L25
.L27:
movl (%esi,%ecx,4),%eax
cmpl %edx,%eax
jle .L28
movl %eax,%edx
.L28:
incl %edx
incl %ecx
cmpl %ebx,%ecx
jl .L27
.L25:
movl %edx,%eax
popl %ebx
popl %esi
movl %ebp,%esp
popl %ebp
ret
C code
int looper(int n, int *a) {
int i;
int x =__________;
for(i=______;
___________;
i++){
if(__________)
x=________;
_________;
}
return x;
}
explanations needed.... thanks your a life saver!
Explanation / Answer
Dear, Answers are highlifghted bold with RED Font int looper(int n, int *a) {int i;
int x = 0;
for(i = 0; i< n ; i++) {
if (a[i] > x)
x = a[i] ;
x++;
}
return x;
} Hope this will help you
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.