hmwk2_prob1_ch - p ret Based on the assembly code above...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
COMPE 271 HOMEWORK 2 Due on 3/_ /2011 1- (Assembly language programming) 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
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %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 ; }...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern