<< Assembly Unit Home

 ! 
 difficulty rating
Objectives
  • Run small assembly programs in the SPIM environment.
  • Watch the values in program registers
  • Watch the program counter (PC) register.
  • Debug small assembly programs in the SPIM environment.

Valid HTML 4.01!

 ! 
SPIM Exercise 0.1 30 Minutes
Load and run this exercise program from your class summary. Remember to initialize the registers as shown in 3a Step 3 on the step-by-step page.
  • List the register operands of your program.
  • Step through the code and watch $t0, $t1, and PC change values in the Registers (top) window of SPIM.
  • What does the program do? check the final values of the register operands of program
  • What does the register PC do? What is the final value?
 ! 
SPIM Exercise 0.2 30 Minutes
Load and run this version of the practice program from your class summary [view]. In this version, only machine instructions are used. Step through the code and watch registers $s0-$s3.
  • What does the program do?
  • What is the final value of PC?

Notice

Going through your program one step at a time and watching your operands is the most important skill to debug small assembly program.