Consider the following assembly code for a C for loop: loop: pushl %ebp movl %es
ID: 3624066 • Letter: C
Question
Consider the following assembly code for a C for loop:loop:
pushl %ebp
movl %esp,%ebp
movl 0x8(%ebp),%edx
movl %edx.%eax
addl 0xc(%ebp),%eax
leal 0xffffffff(%eax),%ecx
cmpl %ecx,%edx
jae .L4
.L6:
movb (%edx),%al
xorb (%ecx),%al
movb %al,(%edx)
xorb (%ecx),%al
movb %al,(%ecx)
xorb %al,(%edx)
incl %edx
decl %ecx
cmpl %ecx,%edx
jb .L6
.L4:
movl %ebp,%esp
popl %ebp
ret
Based on the assembly code above, fill in the blanks below in its corresponding C source code. (Note: you may only use the symbolic variables h, t and len in your expressions below----do not use register names.)
void loop(char *h, int len){
char *t;
for(__________; __________; h++, t--) {
________;
________;
________;
}
return;
}
Thank you soo much for taking the time to help "Life Saver"