{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw2 - Notes make sure that your program computes the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
1 ECE 2500 Computer Organization and Architecture Fall 2007 Homework 2 (Due Friday, September 7 th , 5PM) Assignment [10 points]: Write an assembly program named hw2_ PID .asm (where PID is your VT login) that accomplishes the following: 1. Read an integer, say x , from the spim console window by printing the message “Enter an integer:” You do not need to write this part, it is already given to you as part of this homework. The integer is moved to $s0 in the register file. 2. Store x in memory location 0x10000020. [3 points] 3. Multiple x by 8 and store it to the next integer memory location, loc1 . [2 points] 4. Subtract 1 from result of step 3 and put the result in $t0. [1 points] 5. Print the result of step 4 to the console window in the form “The computed result is: result ”. You do not need to write this part, it is already given to you as part of this homework.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Notes: make sure that your program computes the correct answer! The final result should be “8*x – 1”. Try using F10 to single step through your program, or using breakpoints to debug. Refer to spim help for details. Answer the following questions: 1. What happens if I try to store one of the integers in memory location 0x10000102? [2 points] 2. How could one load the constant value 0x10009020 into register $s2 in MIPS assembly. [2 points] Write up your answers in the Word file hw2_ PID where PID is your VT login. Put you program and answers to the questions in a directory named hw2_ PID . By the due date and time, zip this directory up and submit the resulting zip file to the course digital dropbox and give it the same label as the file name (e.g., hw2_ PID )....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online