lecture 7 instruction set architecture n.
Skip this Video
Loading SlideShow in 5 Seconds..
Lecture 7: Instruction Set Architecture PowerPoint Presentation
Download Presentation
Lecture 7: Instruction Set Architecture

Loading in 2 Seconds...

play fullscreen
1 / 14

Lecture 7: Instruction Set Architecture - PowerPoint PPT Presentation

  • Uploaded on

Lecture 7: Instruction Set Architecture. Computer Engineering 585 Fall 2001. Control Flow Instructions. Cond. Branches, jumps, procedure call/return Branch instruction : while C do if C then for I=x to y do endwhile endif endfor eval C eval C I=x

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Lecture 7: Instruction Set Architecture' - sancho

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
lecture 7 instruction set architecture

Lecture 7: Instruction Set Architecture

Computer Engineering 585

Fall 2001

control flow instructions
Control Flow Instructions
  • Cond. Branches, jumps, procedure call/return
  • Branch instruction:

while C do if C then for I=x to y do

endwhile endif endfor

eval C eval C I=x

Br ¬C, +N Br ¬C, +N Br I==y, +N

PC-relative Branches: PC+N

branch taken
Branch Taken


branch0 R1



  • 90% of the Loop branches taken.


inst N

branch0 R1

Backward-going branch

Forward-going branch

any loop -- for, while)


frequency of forward branches
Frequency of Forward Branches

25% branches: backward

75% branches: forward

Frequency of taken branches: 53%

%Taken = (% Taken backward * % Backward) + (% Taken forward * % forward)

relative frequency of control inst
Relative Frequency of Control Inst

MIPS based measurements

branch offset size
Branch Offset Size

Branch offset: at least 8 bits

Say 16 bit offset is supported --- target 24 bits away!

Branch C, target

Not-Taken code

Branch ¬C, +2

Jump target

Not-Taken code

condition specification



Condition Specification
  • Condition Code: Instructions set C,N,Z,V.
  • Condition Register: Two step process, one ALU inst. sets the condition register, and a branch checks it.
  • Compare & branch: Condition is part of branch instruction. Often comparison against 0.


procedure calls returns
Procedure calls/returns

P1 P2 P3

  • Where is the return address saved? an implicit dedicated register, or a GP register or a memory location.
  • For a register based machine, does P1 save the registers (caller-saving) or does P2 save them (callee-saving).
operand types
Operand types
  • character: a byte; half-word: 2 bytes; word: 4 bytes; double-word: 8 bytes; single-precison FP: 4 bytes; double-precison FP: 8 bytes; character strings: one byte per char; packed decimal: one byte per two decimal digits.
  • How does an instruction know the operand type?
  • Add R1, R2, R3: Is R1 a byte or half-word or word?
  • Either instruction encodes this information: AddH: Add half-words or data carries a tag with it.
operand specification
Operand Specification


Addr Sp 1

Addr Field 1

Addr Sp n

Addr Field n


Addr 1

Addr 2

Addr 3

Addl3 R1, 1024(R2), (R3):

1 byte 1 byte 1+2 bytes 1 byte = 5 bytes

compiler structure
Compiler Structure

Front end

High Level




Code generator