Test #2 Review Sheet

Here's a review sheet for the second test. The ommission of a topic does not mean it is not on the test. You are responsible for class lectures 00-14, homework assignments 1-6 and all of lab1 and lab2. A problem similar to the one similar to the homework 6 problem on this review sheet may appear on the test.

You probably want to look over review sheet #1.


  1. Write C-code for the following assembly:
    	pushl	%ebp
    	movl	%esp, %ebp
    	movl	8(%ebp), %eax
    	leal	-33(%eax), %edx
    	cmpl	$6, %edx
    	jbe	.L12
    	popl	%ebp
    	addl	$10, %eax
    	jmp	*.L8(,%edx,4)
    	.long	.L3
    	.long	.L2
    	.long	.L4
    	.long	.L5
    	.long	.L6
    	.long	.L2
    	.long	.L7
    	popl	%ebp
    	movl	$166, %eax
    	popl	%ebp
    	movl	$66, %eax
    	popl	%ebp
    	movl	$37, %eax
    	popl	%ebp
    	movl	$34, %eax
    	popl	%ebp
    	movl	$46, %eax
  2. Write a Y86 routine for the below C code. Note that you can look at the course notes for help on this.
      int len1 (int a[]) {
        int len;
        for (len = 0; a[len]; len++)
        return len;
  3. Trace the execution of the following Y86 instruction: addl %eax, %edx. See page 283 for the answer format. See page 259 for a list of icodes and ifuns. Also, see page 261 for a listing of register codes.


Valid XHTML 1.1!