Recitation 1 must be submitted
following directions at: submissions on or before
|
Outline: Recitation 1 is an introduction to the Linux Laboratory, to the Unix systems, and to the mechanics of running an assembly language program. The CS Linux Laboratory is located in room 3.01.04 SB. The lab will meet formally in 3.01.04 SB at the beginning most weeks for a 10-minute Recitation Quiz. After the quiz, students can work informally on their recitation assignment and can get help from the recitation instructor.
The CD includes MIPS simulator software which you can download onto Unix flavors such as Mac OS X, as well as (gulp!) Xxxrosoft Zzzindows. With the simulator you can do much of the course work at home, if that is more convenient. The simulator is already installed on the Linux machines, as will be described below.
Common to any Unix are a number of basic commands, entered in a terminal window, including:
You should also become familiar with the following UNIX features:
Note: Appendix A of your text (on the CD that comes with the text) gives very good documentation for the MIPS assembly language (although maybe more detail than you want).
% spim -file fact.s
(You should type 4 (followed by return) at the prompt; then the program will calculate and print 4! or 24.)
% ssh username@gateway10.cs.utsa.edu
% xspim -file fact.s
When the simulator comes up, you can click on run to execute the entire program. After clicking on ok, you will get the same prompt in a new window as before. After entering 4 followed by Return, the program will respond with 24 just as before. Finally click on quit (twice). It is more interesting and useful to execute one instruction at a time: after invoking xspim, click on step instead of run. In the small prompt window, you should keep clicking on step to execute one MIPS instruction at a time.
After 4 steps, you will next execute the instruction jal 0x0040020 [main], followed by the first actual instruction of the fact.s program: addu $s7, $zero, $ra, which appears as addu $23, $0, $31 in the xspim window.
Continue stepping. When you execute the first syscall MIPS instruction, a window with an Enter n: prompt will appear. After executing the next syscall type 4 and Return as before. Then after over 66 more steps, the program will eventually respond with the value 24 and then a newline. (You must enter the 4 and return immediately after stepping through the second syscall instruction.)
Contents of submission
for Recitation 1: Last Name, First Name; Course Number; Recitation Number.
|