Assembly language

# Assembly language - MIPS

This preview shows pages 1–8. Sign up to view the full content.

Problem Session Problem Session Nan Li Nan Li 2006.11 2006.11

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
What will we do? Go over each chapter Important Points Some of exerciseproblems
Outline Big Picture Instruction Set – Tell themachinewhat it should do How can wepresent thosenumbers How can wemeasurethe goodness of a machine How to implement theinstruction set?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Chapter 1
Chapter 2 Three types of Instruction R-type, I-type, J-type Example: MIPS -> High Level Language Thelast question in themidterm High Level Language -> MIPS 1.Theformat and meaning 2.Instruction-> Machine code 3.Machinecode-> Instruction op rs rt rd shamt funct add \$1, \$21, \$29: 000000 10101 11101 00001 00000 100000

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
bne\$s5, \$0, C1 # branch k != 0 add \$s0, \$s3, \$s4 # f = i + j j Exit # break C1: addi \$t0, \$s5, -1 # \$t0 = k - 1 bne\$t0, \$0, C2 # branch k != 1 add \$s0, \$s1, \$s2 # f = g + h j Exit # break C2: addi \$t0, \$s5, -2 # \$t0 = k - 2 bne\$t0, \$0, C3 # branch k != 2 sub \$s0, \$s1, \$s2 # f = g - h j Exit # break C3: addi \$t0, \$s5, -3 # \$t0 = k - 3 bne\$t0, \$0, Exit # branch k != 3 sub \$s0, \$s3, \$s4 # f = i - j Exit: if (k==0) f = i + j; Elseif (k==1) f = g + h; It is a branch If else? For, while?
Chapter 3 Integer Conversion fromonebaseto theother Two’s complement: Positive: Negative: invert and add Calculation How to detect overflow?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern