{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L08-ac-decisions2-proc1-6up

# L08-ac-decisions2-proc1-6up - inst.eecs.berkeley.edu/~cs61c...

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

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

View Full Document
CS61C L8 Decisions(2), Procedures(1) (7) Chae, Summer 2008 © UCB Immediates in Inequalities There is also an immediate version of slt to test against constants: slti Helpful in for loops if (g >= 1) goto Loop Loop: . . . slti \$t0,\$s0,1 # \$t0 = 1 if # \$s0<1 (g<1) beq \$t0,\$0, Loop # goto Loop # if \$t0==0 # (if (g>=1)) C M I P S An slt barb4right beq pair means if(… …)goto… CS61C L8 Decisions(2), Procedures(1) (8) Chae, Summer 2008 © UCB What about unsigned numbers? Also unsigned inequality instructions: sltu , sltiu …which sets result to 1 or 0 depending on unsigned comparisons What is value of \$t0 , \$t1 ? ( \$s0 = FFFF FFFA hex , \$s1 = 0000 FFFA hex ) slt \$t0, \$s0, \$s1 sltu \$t1, \$s0, \$s1 CS61C L8 Decisions(2), Procedures(1) (9) Chae, Summer 2008 © UCB MIPS Signed vs. Unsigned – diff meanings!
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