ICS233_Lecture8 Slides

ICS233_Lecture8 Slides - Computer Architecture &...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 1 MIPS MIPS PROCESSOR PROCESSOR INSTRUCTION SET INSTRUCTION SET ICS 233 ICS 233 Computer Architecture & Computer Architecture & Assembly Language Assembly Language Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 2 ICS 233 ICS 233 Computer Architecture & Computer Architecture & Assembly Language Assembly Language Lecture 8 Lecture 8
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 3 Lecture Outline ± MIPS Compare or Set Less than instructions ± MIPS Conditional Branch Instructions ± MIPS Instruction J-Type Format ± MIPS Unconditional Jump Instructions Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 4 Compare : Set on Less Than Instructions MIPS also provides set on less than instructions slt rd,rs,rt if (rs < rt) rd = 1 else rd = 0 sltu rd,rs,rt unsigned < slti rt,rs,im 16 if (rs < im 16 ) rt = 1 else rt = 0 sltiu rt,rs,im 16 unsigned < Signed / Unsigned Comparisons can produce different results Assume $s0 = 1 and $s1 = -1 = 0xffffffff slt $t0,$s0,$s1 results in $t0 = 0 stlu $t0,$s0,$s1 results in $t0 = 1
Background image of page 2
3 Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 5 MIPS – Comparison Instructions ± slt (set less than) ¾ Instruction Mnemonic : slt rd, rs, rt ;where rs, rt, rd are registers, ¾ Meaning : if (rs < rt ) then rd = 1 else rd = 0 ¾ Example : slt $s1, $s2, $s3 ; if ($s2 < $s3) then $s1=1 else $s1=0 _______________________________________________________ ± slti (set less than immediate) ¾ Instruction Mnemonic : slti rd, rs, const ;where rs, rd are registers, ; const is a 16-bit constant ¾ Meaning : if (rs < const ) then rd = 1 else rd = 0 ¾ Example : slti $s1, $s2, 100 ; if ($s2 < 100) then $s1=1 else $s1=0 Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 6 MIPS – Comparison Instructions ± sltu (set less than unsigned) ¾ Instruction Mnemonic : sltu rd, rs, rt ;where rs, rt, rd are registers, ¾ Meaning : if (rs < rt ) then rd = 1 else rd = 0 ¾
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/27/2011 for the course ICS 253 taught by Professor Arnasser during the Spring '10 term at GWU.

Page1 / 8

ICS233_Lecture8 Slides - Computer Architecture &amp;...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online