n n 1 jr ra return to caller spring 2014 feb 10

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: , $a0, $v0 # n! = n × (n-1)! jr $ra # return to caller Spring 2014, Feb 10 . . . Spring ELEC 5200-001/6200-001 Lecture 4 32 Execution of fact for n ≥ 1 Execution fact Call Sequence Caller 1 2 3 Main Program n fact n-1 fact n-2 fact . fact . fact . fact 3 fact 2 fact 1 fact 0 n-2 n-1 n n+1 Spring 2014, Feb 10 . . . Spring #a0 $ra Returned $v0 PC+4 L1+8 L1+8 n×(n-1)! (n-1)×(n-2)! (n-2)×(n-3)! L1+8 L1+8 L1+8 L1+8 3×2 = 6 2×1 = 2 1×1 = 1 1 ELEC 5200-001/6200-001 Lecture 4 33 Summary A user’s program is processed by several user’s system programs: system – Compiler – Assembler – Linker – Loader – Start-up routine: begins program execution Start-up and at the end of the program issues an exit exit system call. system Spring 2014, Feb 10 . . . Spring ELEC 5200-001/6200-001 Lecture 4 34...
View Full Document

This document was uploaded on 02/23/2014 for the course COMUPER AR 6200 at Auburn University.

Ask a homework question - tutors are online