lab02

.docx

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

210

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

7

Uploaded by CaptainThunderGoldfish14

Report
Kettering University Computer Architecture and Organization Lab Exercise 2 Analysis of MIPS Programs MIPS & SPIM (Cont’d) Winter 2023 Note Tests/final may contain questions about lab exercises. Lab report : Upload one handout (report) per group (in .pdf ) to Blackboard before 11:59 pm on the coming Sunday and after completing all the assignments, answering all the questions, and showing your lab work to the lab instructor individually . A demo sign-up sheet will be posted if necessary. Name : Lab Partner’s Name : Purpose of this lab exercise (please use your own words)
CE-422/622 Computer Architecture and Organization Lab Exercise 02 Objectives Gain hands-on experience with more MIPS instructions as well as MIPS programming styles. Get hands-on experience in program analysis. Practice writing good comments. Learn more about spim . What to hand in Upload this handout in .pdf after completing all the assignments and answering all the questions. Show your functional codes to the lab instructor. Also, be prepared to individually answer the lab instructor’s questions rearguing today’s lab exercise and what your group did. You should work closely with your lab partner. You are also urged to talk to other students, teach them or learn from them, as this will enhance your performance; however, do NOT copy from them! Introduction We may also analyze programs and design programs similar to hardware analysis and hardware design. In today’s lab, you will analyze two programs written in MIPS assembly language and then simulate them using spim to verify your findings. More about SPIM, single-stepping, and breakpoints: You used single-stepping in lab01 and learned how to execute one instruction at a time to debug/test your programs. Remember that after each instruction execution, you can examine the registers and memory locations to see if the implementation is consistent with your expectation. Use F5 to run the whole program nonstop for demonstration purposes, but now you need to put a breakpoint on the instruction right after your program's last instruction. Spim will stop only when it reaches that instruction. To place a breakpoint on an instruction, point to that instruction, then right-click; a window will pop up with four choices. The last two are Set Breakpoint and Clear Breakpoint . You may also combine breakpoints and single-stepping for debugging purposes: use a breakpoint to quickly reach a questionable region in your program and then use single-stepping to locate the first problematic instruction. Write good comments! Add only explanatory and short comments to the instructions in your programs. Your comments should provide as much information as possible. So, if in a program, $s4 is a loop counter , do NOT write a comment like this: # add 1 to $s4 for the following instruction addi $s4, 1 Because it is obvious! It does not provide more information than the instruction itself does. A good comment would be: # Update loop counter Guideline: Avoid using the registers’ assembly names, such as $s4 , in your comments as much as possible. Instead, use meaningful/descriptive names that you assign to the registers. Page 2 of 7
CE-422/622 Computer Architecture and Organization Lab Exercise 02 Page 3 of 7
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help