CS 233 Study Guide - Midterm Guide: Program Counter

56 views3 pages
4 Apr 2016
Course
Professor

Document Summary

Mips control ow instructions: jumps, branches, and loops. So far, only considered sequences of arithmetic instructions. Program counter is incremented by 4 each cycle. We need ways to control which instruction is executed next. Unconditional control ow transfer always taken, much like a goto statement in c j target_label. Uses a label to tell where in the code to jump to: This code is an in nite loop since the j instruction tells it to jump back to the label. To encode jumps we use the j-type instruction format: But, not quite long enough to specify a whole 32-bit pc. Last two bits are always 00, because pc value is always word aligned. 4 most signi cant bits come from existing pc value. Top 4 bits coming from current pc means: Can only jump within current region with a j instruction. A 26-bit address eld lets you jump to any address from 0 to 2^28.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents