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

Info iconThis 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
Background 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

This note was uploaded on 06/07/2011 for the course COMPE 271 taught by Professor Staff during the Spring '08 term at San Diego State.

Ask a homework question - tutors are online