CSE 378 - Spring 1999

Machine Organization and Assembly Language Programming

Problem Set #2

Due Monday, April 12, 1999
Total Points: 50


<turning in details for 3.25 are available here>

  1. Problem 3.2.  (4 pts)
  2. Problem 3.5.  (3 pts)
  3. Problem 3.6. (5 pts)
  4. As discussed on p. 157 and summarized in Fig 3.37, pseudoinstructions are not part of the MIPS instruction set, but often are used in assembly language programs.  For each pseudoinstruction in the table, produce a minimal sequence of actual MIPS instructions to accomplish the same thing.  You may need to use $at for some sequences.  In the following table, big refers to a specific number that requires 32 bits to represent, and small to a number that requires only 16 bits.  (13 pts)

  5.  
    Pseudoinstruction  What it does 
    move $t5, $t1 $t5 = $t1
    clear $t2 $t2 = 0
    li $t5, small $t5 = small
    li $t5, big $t5 = big
    addi $t1, $t2, big $t1 = $t2 + big
    beq $t3, small, L if ($t3 = small) goto L
    bne $t3, big, L if ($t3 != big) goto L 

     
  6. Problem 3.9.  (5 pts)
  7. Problem 3.25. (10 pts)
  8. Problem 4.20. (4 pts)
  9. Problem 4.22. (3 pts)
  10. Problem 4.40. (3 pts)