Mallard - Intro to Computer Engineering I

Mallard - Intro to Computer Engineering I - e.g R6 2 Recall...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Intro to Computer Engineering I v.2000F Mallard Copyright © 1995-2000 user: bly3 Graded WebQuiz: Subroutine Calls You have submitted this WebQuiz 1 time (including this time). You may submit this WebQuiz a total of 6 times and receive full credit. This is not an LC-3 quiz. Assume that the CALL instruction contains the opcode and the subroutine address (not an offset). 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
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e.g. R6). 2. Recall that the stack grows "upward" - i.e., from larger to smaller addresses. 3. Use M[ ] notation to reference memory locations. CALL 8104 SP ← SP-1 M[SP] ← PC PC ← 8104 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 Given initial register and memory values as shown below. Assume that CALL is a 1-word instruction, containing the opcode and the subroutine address. Address Memory Mallard - Intro to Computer Engineering I 1 of 1 5/1/11 2:29 PM...
View Full 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.

Ask a homework question - tutors are online