Presentation is loading. Please wait.

Presentation is loading. Please wait.

PCSpim How to Program ?. Some Resource There are some useful online document! You can find the links on our TAs’ website.http://graphics.im.ntu.edu. tw/~xdd/Arc06/http://graphics.im.ntu.edu.

Similar presentations


Presentation on theme: "PCSpim How to Program ?. Some Resource There are some useful online document! You can find the links on our TAs’ website.http://graphics.im.ntu.edu. tw/~xdd/Arc06/http://graphics.im.ntu.edu."— Presentation transcript:

1 PCSpim How to Program ?

2 Some Resource There are some useful online document! You can find the links on our TAs’ website.http://graphics.im.ntu.edu. tw/~xdd/Arc06/http://graphics.im.ntu.edu. tw/~xdd/Arc06/

3 Get Start Download from http://www.cs.wisc.edu/~larus/spi m.html http://www.cs.wisc.edu/~larus/spi m.html spim is a self-contained simulator that will run MIPS32 assembly language programs

4 Installation Unzip Execute Setup.exe Click “Next”!

5 Documents Download Appendix A: Assemblers, Linkers, and the SPIM Simulator (PDF).PDF Getting Starting with PCSpim (PDF). Overview of the Microsoft Windows version of spim.PDF http://users.ece.gatech.edu/~sudha/20 30/temp/spim/spim_documentation.pdf (From A Walk Through PCSPIM )http://users.ece.gatech.edu/~sudha/20 30/temp/spim/spim_documentation.pdf

6 Sample A very simple Sample http://users.ece.gatech.edu/~sudh a/2030/temp/spim/first-spim.shttp://users.ece.gatech.edu/~sudh a/2030/temp/spim/first-spim.s From “A Walk Through PCSPIM ”

7 Demo Interview the PCSpim’s interface Trace the first-spim.s

8 Assembler Syntax Reference to Documents spim_documentation.pdf HP_AppA.pdf

9 Write Yourself A traditional program “Hello World!!”

10 Assignments There will be 2 problems and 1 extra bonus problem as your assignment. You’ll have to write the mips code for the problems and use PCSpim to execute them. You’ll have to demo your code in front of TAs.

11 Problem 1 Max and Min : Input : A series of Integers. Output : The biggest and smallest number among these Integers. Hint : You are not required to sort them, since you can read the integers one by one. However, your program should be able to deal with any amount of inputs.

12 Problem 2 Euclidean algorithm : Input : Two Integers. Output : The greatest common divisor (GCD) of the two integers. You’ll have to use Euclidean algorithm( 輾轉 相除法 ) to solve this problem. However, you can use multiple subtraction operations instead of division operations.

13 Bonus Problem Factorial : Input : An integer n. Output : n!. Your program should implement big integer operations. That is, you should be able to deal with numbers like 15! =1307674368000. Which is too big to be stored in a integer variable (or register).

14 Submission The deadline is 11/1. Please send your source code to TAs by E- mail before 11:59PM of that day. The file name should be your student id like B91705056.rar. If you want to submit a newer edition of your code, please rename it like B91705056_1.rar.

15 Demo On the demo day you should hand in the documentation of your programs in HARD COPY. Also, you’ll have to demo your program and explain it to TAs. Grading : Program : 60% documentation : 40%

16 Notes You can use any resources you found on the net, or discuss with others. However, any kind of copied codes will get ZERO points. (include the “shared” one). You can Email TAs for any problems you encountered. But we will not help you to do your homework! We will not accept any code after the deadline. And we will not give you any points if you didn’t show up on the demo day.

17 Any questions ?

18 The End Happy Programming !!


Download ppt "PCSpim How to Program ?. Some Resource There are some useful online document! You can find the links on our TAs’ website.http://graphics.im.ntu.edu. tw/~xdd/Arc06/http://graphics.im.ntu.edu."

Similar presentations


Ads by Google