Subroutine Calls - Mallard ECE 290: Computer Engineering I...

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

View Full Document Right Arrow Icon
Mallard ECE 290: Computer Engineering I - Spring 2007 - Graded Web. .. https://mallard.cites.uiuc.edu/ECE290/webgrade.cgi?SessionID=mding3. .. 1 of 2 4/22/2007 8:10 PM Graded WebQuiz: Subroutine Calls You have submitted this WebQuiz 3 times (including this time). You may submit this WebQuiz a total of 10 times and receive full credit. Question #1 To execute a subroutine call, there are 3 steps involved in saving the current program location and moving to the subroutine. Specify these 3 steps (each of a form like PC < -- SP + 1). Notes: 1. Use 'PC' for program counter and use 'SP' for the stack pointer register (rather than e.g. R6). 2. Recall that the stack grows "upward" - i.e., from larger to smaller addresses. CALL 9510 SP < -- SP-1 M[SP] < -- PC PC < -- 9510 At the end of each subroutine, execution returns to the main program. RETURN PC < -- M[SP] SP < -- SP+1 You received a raw score of 100% on this question. Question #2
Background image of page 1

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

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

This note was uploaded on 06/21/2011 for the course ECE 290 taught by Professor Staff during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 2

Subroutine Calls - Mallard ECE 290: Computer Engineering I...

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

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