Topic 4b - Procedures II

Topic 4b - Procedures II - Computer Architecture Procedures...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Computer Architecture Procedures II Reading: Section 2.13 A Glance at the Schedule What’s coming in… Lab2 – Today midnight Hw1 – Monday midnight What’s going out… Outline Procedure examples Recursive Non-recursive Work on relprime() Start thinking about designing an assembler “A computer once beat me at chess, but it was no match for me at kick boxing. . “ Leaf Procedure Example Doesn’t call another procedure C code: int leaf_example (int g, h, i, j) { int f; f = (g + h) - (i + j); return f; } Arguments g, …, j in $a0, …, $a3 CAT #1 Leaf Procedure Example Assuming that $T0 and $T1 have to be saved MIPS code: leaf_example: addi $sp, $sp, -4 sw $s0, 0($sp) add $t0, $a0, $a1 add $t1, $a2, $a3 sub $s0, $t0, $t1 add $v0, $s0, $zero lw $s0, 0($sp) To Preserve or Not??To Preserve or Not?...
View Full Document

This document was uploaded on 01/20/2012.

Page1 / 16

Topic 4b - Procedures II - Computer Architecture Procedures...

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

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