Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

MIPS Programming: Control Flow and Register Usage, Assignments of Computer Architecture and Organization

Examples of mips program control flow and register usage, including incorrect usage of jump instructions. Students should be able to understand how control flows in given mips programs and analyze the impact of register usage on saving registers.

Typology: Assignments

Pre 2010

Uploaded on 03/10/2009

koofers-user-z60-1
koofers-user-z60-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download MIPS Programming: Control Flow and Register Usage and more Assignments Computer Architecture and Organization in PDF only on Docsity! CS232 Fall 2006 Lecture 3: Questions After reading the notes for the Lecture on 9/1, you should be able to answer questions like these: 1. Describe how control would flow in the following MIPS program: main: j getRandom # Call function getRandom # oops, used j instead of jal! j getRandom jr $ra getRandom: # function getRandom jr $ra 2. Describe how control would flow in the following MIPS program: main: li $t0, 10 loop: beq $t0, $0, done sub $t0, $t0, 1 jal loop # oops, used jal instead of j! done: jr $ra 3. Suppose function A calls function B. By choosing the set of registers used by A and the set of registers modified by B appropriately, show that none of the the three strategies for saving registers given on Slides 11–13 always saves the fewest number of registers. Thus, none of these strategies is “best possible”. 1
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved