ICS233_Lecture11 Slides

ICS233_Lecture11 Slides - Computer Architecture &...

Info iconThis preview shows pages 1–5. 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 11 Lecture 11
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 Procedure Call Instructions ± MIPS Procedure Return Instructions ± Parameter Passing Architecture ICS 233 @ Dr A R Naseer Instructions for Procedures 9 0 8 0 0 0 rs 5 op 6 = 0 PC = Rs jr Rs rd 5 0 rs 5 op 6 = 0 Rd=PC+4, PC=Rs jalr Rd, Rs imm 26 op 6 = 3 $31=PC+4, jump jal label Format Meaning Instruction JAL ( Jump-and-Link ) used as the call instruction – Save return address in $ra = PC+4 and jump to procedure – Register $ra = $31 is used by JAL as the return address JR ( Jump Register ) used to return from a procedure – Jump to instruction whose address is in register Rs (PC = Rs) JALR ( Jump-and-Link Register ) – Save return address in Rd = PC+4, and – Jump to procedure whose address is in register Rs (PC = Rs) – Can be used to call methods (addresses known only at runtime)
Background image of page 2
3 Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 5 MIPS – Procedure Call Instruction ± jal (jump and link) ¾ Instruction Mnemonic : jal addr ;where addr is the label of the target location ¾ Meaning : Jump to the location addr and store the address of the next instruction in $ra( i .e . , ± ±$ ra= ±PC ±+4 ±& ± ± jump to target address addr) ¾ Example : jal loop ; $ra = PC + 4; goto location having the label loop (used for procedure call) Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 6 MIPS – Procedure Return Instruction ± jr (jump to address in register) ¾ Instruction Mnemonic : jr rs ;where rs specifies the target address for jump ¾ Meaning : jump to target address specified in register rs ¾ Example : jr $ra ; goto $ra (used for procedure return)
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Lecture Slides on Computer Architecture ICS 233 @ Dr A R Naseer 7 MIPS – Procedure Call Instruction ± jalr
Background image of page 4
Image of page 5
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 / 10

ICS233_Lecture11 Slides - Computer Architecture &...

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

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