Computer Science 104:! Y86 & Single Cycle Processor Design!

Size: px
Start display at page:

Download "Computer Science 104:! Y86 & Single Cycle Processor Design!"

Transcription

1 Computer Science 104: Y86 & Single Cycle Processor Design Alvin R. Lebeck Slides based on those from Randy Bryant 1 CS:APP Administrative Homework #4 My office hours today 11:30-12:30 Reading: text CS:APP

2 Bit Equality Bit equal a HCL Expression eq bool eq = (a&&b) (a&&b) b n Generate 1 if a and b are equal Hardware Control Language (HCL) n Very simple hardware description language l Boolean operations have syntax similar to C logical operations n We ll use it to describe control logic for processors 3 CS:APP Word Equality Word-Level Representation b 31 a 31 b 30 Bit equal Bit equal eq 31 eq 30 B A = Eq a 30 HCL Representation Eq bool Eq = (A == B) b 1 a 1 b 0 a 0 Bit equal Bit equal eq 1 eq 0 n 32-bit word size n HCL representation l Equality operation l Generates Boolean value 4 CS:APP

3 Bit-Level Multiplexor s Bit MUX HCL Expression b out bool out = (s&&a) (s&&b) a n Control signal s n Data signals a and b n Output a when s=1, b when s=0 5 CS:APP Word Multiplexor s Word-Level Representation s b 31 out 31 B A MUX Out a 31 b 30 a 30 out 30 HCL Representation int Out = [ s : A; 1 : B; ]; b 0 out 0 n Select input word A or B depending on control signal s n HCL representation l Case expression l Series of test : value pairs l Output value for first a 0 successful test 6 CS:APP

4 HCL Word-Level Examples Minimum of 3 Words C B A MIN3 Min3 int Min3 = [ A < B && A < C : A; B < A && B < C : B; 1 : C; ]; n Find minimum of three input words n HCL case expression n Final case guarantees match 4-Way Multiplexor s1 s0 D0 D1 D2 D3 MUX4 Out4 int Out4 = [ s1&&s0: D0; s1 : D1; s0 : D2; 1 : D3; ]; n Select one of 4 inputs based on two control bits n HCL case expression n Simplify tests by assuming sequential matching 7 CS:APP Random-Access Memory vala Read ports srca valb A Register file valw W dstw Write port srcb B n Stores multiple words of memory l Address input specifies which word to read or write n Register file l Holds values of program registers l %eax, %esp, etc. l Register identifier serves as address» ID 8 implies no read or write performed n Multiple Ports Clock l Can read and/or write multiple words in one cycle» Each has separate address and data input/output 8 CS:APP

5 Register File Timing x 2 vala srca valb srcb A B 2 x Register file Reading n Like combinational logic n Output data generated based on input address l After some delay Writing n Like register n Update only as clock rises 2 x Register file valw W dstw y 2 _ Rising clock _ 2 y Register file valw W dstw Clock Clock 9 CS:APP Instruction Set Architecture Assembly Language View n Processor state l Registers, memory, n Instructions l addl, movl, leal, l How instructions are encoded as bytes Layer of Abstraction n Above: how to program machine l Processor executes instructions in a sequence n Below: what needs to be built l Use variety of tricks to make it run fast l E.g., execute multiple instructions simultaneously Application Program Compiler ISA CPU Design Circuit Design Chip Layout 10 CS:APP OS

6 Y86: A simpler Instruction Set IA32 has too many instructions IA32 has too many quirks Y86 subset of IA32 instructions Y86 simpler enconding than IA32 Y86 easier to reason about -> better for understanding hardware 11 CS:APP Y86 Processor State Program registers %eax %ecx %edx %ebx %esi %edi %esp %ebp Condition codes OF ZF SF PC Memory n Program Registers l Same 8 as with IA32. Each 32 bits n Condition Codes l Single-bit flags set by arithmetic or logical instructions» OF: Overflow ZF: Zero SF:Negative n Program Counter l Indicates address of instruction n Memory l Byte-addressable storage array l Words stored in little-endian byte order 12 CS:APP

7 Y86 Instructions Recall Memory is a Bunch of Bits How do we know if it is an instruction or not? How do we know which instruction, which operands, etc. Format n 1--6 bytes of information read from memory l Can determine instruction length from first byte l Not as many instruction types, and simpler encoding than with IA32 n Each accesses and modifies some part(s) of the program state 13 CS:APP Encoding Registers Each register has 4-bit ID %eax %ecx %edx %ebx n Same encoding as in IA32 %esi %edi %esp %ebp Register ID 8 indicates no register n Will use this in our hardware design in multiple places 14 CS:APP

8 Instruction Example Addition Instruction Generic Form addl ra, rb 6 0 rarb Encoded Representation n Add value in register ra to that in register rb l Store result in register rb l Note that Y86 only allows addition to be applied to register data n Set condition codes based on result n e.g., addl %eax,%esi Encoding: n Two-byte encoding l First byte indicates instruction type l Second byte gives source and destination registers 15 CS:APP Arithmetic and Logical Operations Instruction Code Add addl ra, rb Subtract (ra from rb) And subl ra, rb Function Code 6 0 rarb 6 1 rarb n Refer to generically as OPl n Encodings differ only by function code l Low-order 4 bytes in first instruction word n Set condition codes as side effect andl ra, rb 6 2 rarb Exclusive-Or xorl ra, rb 6 3 rarb 16 CS:APP

9 Move Operations rrmovl ra, rb 2 0 rarb Register --> Register irmovl V, rb rb V Immediate --> Register rmmovl ra, D(rB) 4 0 rarb D Register --> Memory mrmovl D(rB), ra 5 0 rarb D Memory --> Register n Like the IA32 movl instruction n Simpler format for memory addresses n Give different names to keep them distinct 17 CS:APP Move Instruction Examples IA32 Y86 Encoding movl $0xabcd, %edx irmovl $0xabcd, %edx cd ab movl %esp, %ebx rrmovl %esp, %ebx movl -12(%ebp),%ecx movl %esi,0x41c(%esp) mrmovl -12(%ebp),%ecx rmmovl %esi,0x41c(%esp) f4 ff ff ff c movl $0xabcd, (%eax) movl %eax, 12(%eax,%edx) movl (%ebp,%eax,4),%ecx 18 CS:APP

10 Jump Instructions Jump Unconditionally jmp Dest 7 0 Dest Jump When Less or Equal jle Dest 7 1 Dest Jump When Less jl Dest 7 2 Dest Jump When Equal je Dest 7 3 Dest Jump When Not Equal jne Dest 7 4 Dest Jump When Greater or Equal n Refer to generically as jxx n Encodings differ only by function code n Based on values of condition codes n Same as IA32 counterparts n Encode full destination address l Unlike PC-relative addressing seen in IA32 jge Dest 7 5 Dest Jump When Greater jg Dest 7 6 Dest 19 CS:APP Y86 Program Stack Increasing Addresses Stack Bottom Stack Top %esp n Region of memory holding program data n Used in Y86 (and IA32) for supporting procedure calls n Stack top indicated by %esp l Address of top stack element n Stack grows toward lower addresses l Top element is at highest address in the stack l When pushing, must first decrement stack pointer l When popping, increment stack pointer 20 CS:APP

11 Stack Operations pushl ra a 0 ra 8 n Decrement %esp by 4 n Store word from ra to memory at %esp n Like IA32 popl ra b 0 ra 8 n Read word from memory at %esp n Save in ra n Increment %esp by 4 n Like IA32 21 CS:APP Subroutine Call and Return call Dest 8 0 Dest n Push address of next instruction onto stack n Start executing instructions at Dest n Like IA32 ret 9 0 n Pop value from stack n Use as address for next instruction n Like IA32 22 CS:APP

12 Miscellaneous Instructions nop 0 0 n Don t do anything halt 1 0 n Stop executing instructions n IA32 has comparable instruction, but can t execute it in user mode 23 CS:APP Y86 Instruction Set Byte nop 0 0 halt 1 0 rrmovl ra, rb 2 0 ra rb irmovl V, rb rb V addl 6 0 subl 6 1 andl 6 2 xorl 6 3 rmmovl ra, D(rB) 4 0 ra rb D jmp 7 0 mrmovl D(rB), ra 5 0 ra rb D jle 7 1 OPl ra, rb 6 fn ra rb jl 7 2 jxx Dest 7 fn Dest je 7 3 call Dest 8 0 Dest jne 7 4 ret 9 0 jge 7 5 pushl ra A 0 ra 8 jg 7 6 popl ra B 0 ra 8 24 CS:APP

13 Building Blocks fun Combinational Logic n Compute Boolean functions of inputs n Continuously respond to input changes n Operate on data and implement control A B A L U 0 MUX 1 = Storage Elements n Store bits n Addressable memories n Non-addressable registers n Loaded only as clock rises vala srca valb srcb A B Register file valw W dstw Clock Clock 25 CS:APP SEQ Hardware Structure PC (Abstract) State n Program counter register (PC) n Condition code register (CC) n Register File n Memories l Access same memory space l Data: for reading/writing program data l Instruction: for reading instructions Instruction Flow n Read instruction at address specified by PC n Process through stages n Update program counter Write back Memory Execute Decode Fetch icode, ifun ra,rb valc Instruction memory Data memory PC increment 26 CS:APP PC newpc vale, valm Addr, Data valm Bch CC alua, alub srca, srcb dsta, dstb valp vale ALU vala, valb A B M E Register file

14 SEQ Stages Fetch Decode n Read instruction from instruction memory n If PC points to it, we view it as instruction n Read program registers Execute n Compute value or address Memory n Read or write data Write Back PC n Write program registers n Update program counter Write back Memory Execute Decode Fetch icode, ifun ra,rb valc Instruction memory PC increment 27 CS:APP PC PC newpc vale, valm Addr, Data Bch CC alua, alub srca, srcb dsta, dstb valm Data memory valp vale ALU vala, valb Register A B M file E Instruction Decoding Optional Optional 5 0 ra rb D icode ifun ra rb valc Instruction Format n Instruction byte n Optional register byte icode:ifun ra:rb n Optional constant word valc 28 CS:APP

15 Executing Arith./Logical Operation OPl ra, rb Fetch n Read 2 bytes Decode n Read operand registers Execute n Perform operation n Set condition codes 6 fn rarb Memory n Do nothing Write back n Update register PC Update n Increment PC by 2 29 CS:APP Stage Computation: Arith/Log. Ops Fetch Decode Execute OPl ra, rb icode:ifun M 1 [PC] ra:rb M 1 [PC+1] valp PC+2 vala R[rA] valb R[rB] vale valb OP vala Set CC Read instruction byte Read register byte n Formulate instruction execution as sequence of simple steps n Use same general form for all instructions; often called Register Transfer Language (RTL) 30 CS:APP Compute next PC Read operand A Read operand B Perform ALU operation Set condition code register Memory Write R[rB] vale Write back result back PC update PC valp Update PC

16 Executing rmmovl rmmovl ra, D(rB) 4 0 rarb D Fetch n Read 6 bytes Decode n Read operand registers Execute n Compute effective address Memory n Write to memory Write back n Do nothing PC Update n Increment PC by 6 31 CS:APP Stage Computation: rmmovl Fetch Decode Execute rmmovl ra, D(rB) icode:ifun M 1 [PC] ra:rb M 1 [PC+1] valc M 4 [PC+2] valp PC+6 vala R[rA] valb R[rB] vale valb + valc Read instruction byte Read register byte Read displacement D Compute next PC Read operand A Read operand B Compute effective address Memory M 4 [vale] vala Write value to memory Write back PC update PC valp Update PC n Use ALU for address computation 32 CS:APP

17 Executing popl popl ra b 0 ra 8 Fetch n Read 2 bytes Decode n Read stack pointer Execute n Increment stack pointer by 4 Memory n Read from old stack pointer Write back n Update stack pointer n Write result to register PC Update n Increment PC by 2 33 CS:APP Stage Computation: popl Fetch Decode Execute popl ra icode:ifun M 1 [PC] ra:rb M 1 [PC+1] valp PC+2 vala R[%esp] valb R [%esp] vale valb + 4 Read instruction byte Read register byte Compute next PC Read stack pointer Read stack pointer Increment stack pointer Memory valm M 4 [vala] Read from stack Write R[%esp] vale Update stack pointer back R[rA] valm PC update PC valp Write back result Update PC n Use ALU to increment stack pointer n Must update two registers l Popped value l New stack pointer 34 CS:APP

18 Executing Jumps jxx Dest 7 fn Dest fall thru: XX XX Not taken target: XX XX Taken Fetch Decode n Read 5 bytes n Increment PC by 5 Memory n Do nothing Write back n Do nothing n Do nothing PC Update Execute n Set PC to Dest if branch n Determine whether to take taken or to incremented PC branch based on jump if not branch condition and condition codes 35 CS:APP Stage Computation: Jumps jxx Dest icode:ifun M 1 [PC] Read instruction byte Fetch Decode valc M 4 [PC+1] valp PC+5 Read destination address Fall through address Execute Bch Cond(CC,ifun) Memory Write Take branch? back PC update PC Bch? valc : valp Update PC n Compute both addresses n Choose based on setting of condition codes and branch condition 36 CS:APP

19 Executing call call Dest 8 0 Dest return: XX XX target: XX XX Fetch Decode n Read 5 bytes n Increment PC by 5 n Read stack pointer Execute n Decrement stack pointer by 4 Memory n Write incremented PC to new value of stack pointer Write back n Update stack pointer PC Update n Set PC to Dest 37 CS:APP Stage Computation: call call Dest icode:ifun M 1 [PC] Read instruction byte Fetch Decode Execute valc M 4 [PC+1] valp PC+5 valb R[%esp] vale valb + 4 Read destination address Compute return point Read stack pointer Decrement stack pointer Memory M 4 [vale] valp Write return value on stack Write R[%esp] vale Update stack pointer back PC update PC valc Set PC to destination n Use ALU to decrement stack pointer n Store incremented PC 38 CS:APP

20 Executing ret ret 9 0 return: XX XX Fetch n Read 1 byte Decode n Read stack pointer Execute n Increment stack pointer by 4 Memory n Read return address from old stack pointer Write back n Update stack pointer PC Update n Set PC to return address 39 CS:APP Stage Computation: ret Fetch ret icode:ifun M 1 [PC] Read instruction byte Decode Execute Memory Write back PC update vala R[%esp] valb R[%esp] vale valb + 4 valm M 4 [vala] R[%esp] vale PC valm Read operand stack pointer Read operand stack pointer Increment stack pointer Read return address Update stack pointer Set PC to return address n Use ALU to increment stack pointer n Read return address from memory 40 CS:APP

21 Computation Steps icode,ifun OPl ra, rb icode:ifun M 1 [PC] Read instruction byte Fetch ra,rb ra:rb M 1 [PC+1] Read register byte valc [Read constant word] valp valp PC+2 Compute next PC Decode vala, srca vala R[rA] Read operand A valb, srcb valb R[rB] Read operand B Execute vale vale valb OP vala Perform ALU operation Cond code Set CC Set condition code register Memory valm [Memory read/write] Write back dste dstm R[rB] vale Write back ALU result [Write back memory result] PC update PC PC valp Update PC n All instructions follow same general pattern n Differ in what gets computed on each step 41 CS:APP Computation Steps Fetch Decode Execute Memory Write back PC update icode,ifun ra,rb valc valp vala, srca valb, srcb vale Cond code valm dste dstm PC call Dest icode:ifun M 1 [PC] valc M 4 [PC+1] valp PC+5 valb R[%esp] vale valb + 4 M 4 [vale] valp R[%esp] vale PC valc Read instruction byte [Read register byte] Read constant word Compute next PC [Read operand A] Read operand B Perform ALU operation [Set condition code reg.] [Memory read/write] [Write back ALU result] Write back memory result Update PC n All instructions follow same general pattern n Differ in what gets computed on each step 42 CS:APP

22 Computed Values Fetch icode ifun Instruction code Instruction function ra Instr. Register A rb Instr. Register B valc valp Instruction constant Incremented PC Execute n vale n Bch Memory ALU result Branch flag n valm Value from memory Decode srca Register ID A srcb Register ID B dste Destination Register E dstm Destination Register M vala Register value A valb Register value B 43 CS:APP Summary Y86: a simpler instruction set than IA32 Data path: the hardware structure (connections) of components and flow of data between and through these components to implement the various instructions. Specifically the fetch/execute cycle. Next Time: Control for the data path 44 CS:APP

Computer Science 104:! Y86 & Single Cycle Processor Design!

Computer Science 104:! Y86 & Single Cycle Processor Design! Computer Science 104:! Y86 & Single Cycle Processor Design! Alvin R. Lebeck! Slides based on those from Randy Bryant 1! CS:APP! CS:APP! Administrative! 2! CS:APP! Instruction Set Architecture! Application!

More information

Sequential Implementation

Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant adapted by Jason Fritts http://csapp.cs.cmu.edu CS:APP2e Hardware Architecture - using Y86 ISA For learning aspects of

More information

CS:APP Chapter 4 Computer Architecture Sequential Implementation

CS:APP Chapter 4 Computer Architecture Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Y86 Instruction Set Byte 0 1 2 3 4 5 nop 0 0 halt 1 0 rrmovl

More information

Background: Sequential processor design. Computer Architecture and Systems Programming , Herbstsemester 2013 Timothy Roscoe

Background: Sequential processor design. Computer Architecture and Systems Programming , Herbstsemester 2013 Timothy Roscoe Background: Sequential processor design Computer Architecture and Systems Programming 252 0061 00, Herbstsemester 2013 Timothy Roscoe Overview Y86 instruction set architecture Processor state Instruction

More information

Computer Science 104:! Y86 & Single Cycle Processor Design!

Computer Science 104:! Y86 & Single Cycle Processor Design! Computer Science 104: Y86 & Single Cycle Processor Design Alvin R. Lebeck Slides based on those from Randy Bryant CS:APP Administrative HW #4 Due tomorrow tonight HW #5 up soon ing: 4.1-4.3 Today Review

More information

Giving credit where credit is due

Giving credit where credit is due CSCE 230J Computer Organization Processor Architecture III: Sequential Implementation Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due

More information

CS:APP Chapter 4 Computer Architecture Sequential Implementation

CS:APP Chapter 4 Computer Architecture Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant Carnegie Mellon University CS:APP Y86 Instruction Set Byte ra rb ra rb V rb rb V ra D rb ra rb D D rb ra ra rb D ra rb

More information

Computer Science 104:! Y86 & Single Cycle Processor Design!

Computer Science 104:! Y86 & Single Cycle Processor Design! Computer Science 104:! Y86 & Single Cycle Processor Design! Alvin R. Lebeck! Slides based on those from Randy Bryant CS:APP! Administrative! 2! CS:APP! Y86 Instruction Set! Byte! 0 1 2 3 4 5 nop 0 0 halt

More information

Processor Architecture II! Sequential! Implementation!

Processor Architecture II! Sequential! Implementation! Processor Architecture II! Sequential! Implementation! Lecture 6, April 14 th 2011 Alexandre David Slides by Randal E. Bryant! Carnegie Mellon University! Y86 Instruction Set! Byte! 0 1 2 3 4 5 nop 0 0

More information

CISC: Stack-intensive procedure linkage. [Early] RISC: Register-intensive procedure linkage.

CISC: Stack-intensive procedure linkage. [Early] RISC: Register-intensive procedure linkage. CISC: Stack-intensive procedure linkage. The stack is used for procedure arguments and return addresses. [Early] RISC: Register-intensive procedure linkage. Registers are used for procedure arguments and

More information

Chapter 4! Processor Architecture!!

Chapter 4! Processor Architecture!! Chapter 4! Processor Architecture!! Sequential Implementation! Instructor: Dr. Hyunyoung Lee! Texas A&M University! Based on slides provided by Randal E. Bryant, CMU Topics Covered! Hardware Control Language

More information

Stage Computation: Arith/Log. Ops

Stage Computation: Arith/Log. Ops Stage Computation: Arith/Log. Ops OPl ra, rb Fetch icode:ifun M 1 [PC] ra:rb M 1 [PC+1] Read instruction byte Read register byte back valp PC+2 vala R[rA] valb R[rB] vale valb OP vala Set CC R[rB] vale

More information

CISC Fall 2009

CISC Fall 2009 Michela Taufer October 20, 2009 Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and D. O'Hallaron, Prentice Hall, 2003 Y86 Instruction Set Byte 0 1 2 3 4 5 nop 0 0

More information

CS:APP Chapter 4 Computer Architecture Sequential Implementation

CS:APP Chapter 4 Computer Architecture Sequential Implementation CS:APP Chapter 4 Computer Architecture Sequential Implementation Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Y86 Instruction Set Byte 0 1 2 3 4 5 nop 0 0 halt 1 0 rrmovl

More information

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ)

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ) Systems I Datapath Design II Topics Control flow instructions Hardware for sequential machine (SEQ) Executing Jumps jxx Dest 7 fn Dest fall thru: XX XX Not taken target: XX XX Taken Read 5 bytes Increment

More information

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ)

Systems I. Datapath Design II. Topics Control flow instructions Hardware for sequential machine (SEQ) Systems I Datapath Design II Topics Control flow instructions Hardware for sequential machine (SEQ) Executing Jumps jxx Dest 7 fn Dest fall thru: XX XX Not taken target: XX XX Taken Fetch Decode Read 5

More information

CS:APP Chapter 4! Computer Architecture! Sequential! Implementation!

CS:APP Chapter 4! Computer Architecture! Sequential! Implementation! CS:APP Chapter 4! Computer Architecture! Sequential! Implementation! Randal E. Bryant! Carnegie Mellon University! http://csapp.cs.cmu.edu CS:APP2e! Y86 Instruction Set #1! Byte! 0 1 2 3 4 5 halt 0 0 nop

More information

Instruction Set Architecture

Instruction Set Architecture CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant adapted by Jason Fritts http://csapp.cs.cmu.edu CS:APP2e Hardware Architecture - using Y86 ISA For learning aspects

More information

God created the integers, all else is the work of man Leopold Kronecker

God created the integers, all else is the work of man Leopold Kronecker Sequential Hardware God created the integers, all else is the work of man Leopold Kronecker (He believed in the reduction of all mathematics to arguments involving only the integers and a finite number

More information

Where Have We Been? Logic Design in HCL. Assembly Language Instruction Set Architecture (Y86) Finite State Machines

Where Have We Been? Logic Design in HCL. Assembly Language Instruction Set Architecture (Y86) Finite State Machines Where Have We Been? Assembly Language Instruction Set Architecture (Y86) Finite State Machines States and Transitions Events Where Are We Going? Tracing Instructions at the Register Level Build a CPU!

More information

Instruction Set Architecture

Instruction Set Architecture CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Instruction Set Architecture Assembly Language View Processor

More information

Instruction Set Architecture

Instruction Set Architecture CS:APP Chapter 4 Computer Architecture Instruction Set Architecture Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Instruction Set Architecture Assembly Language View! Processor

More information

CSC 252: Computer Organization Spring 2018: Lecture 11

CSC 252: Computer Organization Spring 2018: Lecture 11 CSC 252: Computer Organization Spring 2018: Lecture 11 Instructor: Yuhao Zhu Department of Computer Science University of Rochester Action Items: Assignment 3 is due March 2, midnight Announcement Programming

More information

Y86 Processor State. Instruction Example. Encoding Registers. Lecture 7A. Computer Architecture I Instruction Set Architecture Assembly Language View

Y86 Processor State. Instruction Example. Encoding Registers. Lecture 7A. Computer Architecture I Instruction Set Architecture Assembly Language View Computer Architecture I Instruction Set Architecture Assembly Language View Processor state Registers, memory, Instructions addl, movl, andl, How instructions are encoded as bytes Layer of Abstraction

More information

Computer Organization Chapter 4. Prof. Qi Tian Fall 2013

Computer Organization Chapter 4. Prof. Qi Tian Fall 2013 Computer Organization Chapter 4 Prof. Qi Tian Fall 2013 1 Topics Dec. 6 (Friday) Final Exam Review Record Check Dec. 4 (Wednesday) 5 variable Karnaugh Map Quiz 5 Dec. 2 (Monday) 3, 4 variables Karnaugh

More information

Overview. CS429: Computer Organization and Architecture. Y86 Instruction Set. Building Blocks

Overview. CS429: Computer Organization and Architecture. Y86 Instruction Set. Building Blocks Overview CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: March 15, 2018 at 10:54 How do we build a digital computer?

More information

CISC 360 Instruction Set Architecture

CISC 360 Instruction Set Architecture CISC 360 Instruction Set Architecture Michela Taufer October 9, 2008 Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and D. O'Hallaron, Prentice Hall, 2003 Chapter

More information

Instruction Set Architecture

Instruction Set Architecture CISC 360 Instruction Set Architecture Michela Taufer October 9, 2008 Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and D. O'Hallaron, Prentice Hall, 2003 Chapter

More information

Giving credit where credit is due

Giving credit where credit is due JDEP 284H Foundations of Computer Systems Processor rchitecture III: Sequential Implementation Dr. Steve Goddard goddard@cse.unl.edu Giving credit where credit is due Most of slides for this lecture are

More information

Y86 Instruction Set. SEQ Hardware Structure. SEQ Stages. Sequential Implementation. Lecture 8 Computer Architecture III.

Y86 Instruction Set. SEQ Hardware Structure. SEQ Stages. Sequential Implementation. Lecture 8 Computer Architecture III. Building Blocks Combinational Logic Compute Boolean functions of inputs Continuously respond to input changes Operate on data and implement control Storage Elements Store bits Lecture 8 Computer rchitecture

More information

Chapter 4! Processor Architecture!

Chapter 4! Processor Architecture! Chapter 4! Processor Architecture!! Y86 Instruction Set Architecture! Instructor: Dr. Hyunyoung Lee! Texas A&M University! Based on slides provided by Randal E. Bryant, CMU Why Learn Processor Design?!

More information

Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary

Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary Chapter 4 Processor Architecture: Y86 (Sections 4.1 & 4.3) with material from Dr. Bin Ren, College of William & Mary 1 Outline Introduction to assembly programing Introduction to Y86 Y86 instructions,

More information

Foundations of Computer Systems

Foundations of Computer Systems 18-600 Foundations of Computer Systems Lecture 7: Processor Architecture & Design John P. Shen & Gregory Kesden September 20, 2017 Lecture #7 Processor Architecture & Design Lecture #8 Pipelined Processor

More information

Sequential CPU Implementation.

Sequential CPU Implementation. Sequential CPU Implementation Y86 Instruction Set P259 Byte 0 1 2 3 4 5 nop 0 0 halt 1 0 rrmovl ra, rb 2 0 ra rb irmovl V, rb 3 0 8 rb V rmmovl ra, D(rB) 4 0 ra rb D mrmovl D(rB), ra 5 0 ra rb D OPl ra,

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Warren Hunt, Jr. and Bill Young Department of Computer Sciences University of Texas at Austin Last updated: October 1, 2014 at 12:03 CS429 Slideset 6: 1 Topics

More information

Processor Architecture

Processor Architecture Processor Architecture God created the integers, all else is the work of man Leopold Kronecker (He believed in the reduction of all mathematics to arguments involving only the integers and a finite number

More information

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb D mrmovq D(rB), ra 5 0 ra rb D OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb D mrmovq D(rB), ra 5 0 ra rb D OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest Computer Architecture: Y86-64 Sequential Implementation CSci 2021: Machine Architecture and Organization Lecture #19, March 4th, 2016 Your instructor: Stephen McCamant Based on slides originally by: Randy

More information

cmovxx ra, rb 2 fn ra rb irmovl V, rb rb V rmmovl ra, D(rB) 4 0 ra rb D mrmovl D(rB), ra 5 0 ra rb D OPl ra, rb 6 fn ra rb jxx Dest 7 fn Dest

cmovxx ra, rb 2 fn ra rb irmovl V, rb rb V rmmovl ra, D(rB) 4 0 ra rb D mrmovl D(rB), ra 5 0 ra rb D OPl ra, rb 6 fn ra rb jxx Dest 7 fn Dest Instruction Set Architecture Instruction Set Architecture CSci 2021: Machine Architecture and Organization Lecture #16, February 25th, 2015 Your instructor: Stephen McCamant Based on slides originally

More information

CPSC 121: Models of Computation. Module 10: A Working Computer

CPSC 121: Models of Computation. Module 10: A Working Computer CPSC 121: Models of Computation Module 10: A Working Computer Module 10: A Working Computer???build a computer that is?able to 1. How can we?execute a user-defined program? We are finally able to answer

More information

CPSC 121: Models of Computation. Module 10: A Working Computer

CPSC 121: Models of Computation. Module 10: A Working Computer CPSC 121: Models of Computation The 10th online quiz is due Tuesday, March 26 th at 17:00. Assigned reading for the quiz: Epp, 4th edition: 6.1, 7.1 Epp, 3rd edition: 5.1, 6.1 Rosen, 6th edition: 2.1,

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr Bill Young Department of Computer Sciences University of Texas at Austin Last updated: March 15, 2018 at 10:58 CS429 Slideset 13: 1 The ISA Byte 0 1 2 3

More information

Reading assignment. Chapter 3.1, 3.2 Chapter 4.1, 4.3

Reading assignment. Chapter 3.1, 3.2 Chapter 4.1, 4.3 Reading assignment Chapter 3.1, 3.2 Chapter 4.1, 4.3 1 Outline Introduc5on to assembly programing Introduc5on to Y86 Y86 instruc5ons, encoding and execu5on 2 Assembly The CPU uses machine language to perform

More information

cs281: Computer Systems CPUlab ALU and Datapath Assigned: Oct. 30, Due: Nov. 8 at 11:59 pm

cs281: Computer Systems CPUlab ALU and Datapath Assigned: Oct. 30, Due: Nov. 8 at 11:59 pm cs281: Computer Systems CPUlab ALU and Datapath Assigned: Oct. 30, Due: Nov. 8 at 11:59 pm The objective of this exercise is twofold to complete a combinational circuit for an ALU that we can use with

More information

The ISA. Fetch Logic

The ISA. Fetch Logic The ISA CS429: Computer Organization and Architecture Dr Bill Young Department of Computer Science University of Texas at Austin Last updated: July 5, 2018 at 11:55 Byte 0 1 2 3 4 5 6 7 8 9 halt 0 0 nop

More information

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb D mrmovq D(rB), ra 5 0 ra rb D OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb D mrmovq D(rB), ra 5 0 ra rb D OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest Computer Architecture: Y86-64 Sequential Implementation CSci 2021: Machine Architecture and Organization October 31st, 2018 Your instructor: Stephen McCamant Based on slides originally by: Randy Bryant

More information

cs281: Introduction to Computer Systems CPUlab Datapath Assigned: Oct. 29, Due: Nov. 3

cs281: Introduction to Computer Systems CPUlab Datapath Assigned: Oct. 29, Due: Nov. 3 cs281: Introduction to Computer Systems CPUlab Datapath Assigned: Oct. 29, Due: Nov. 3 The objective of this exercise is to familiarize you with the Datapath of the Y86 CPU and to introduce you to the

More information

Review. Computer Science 104 Machine Organization & Programming

Review. Computer Science 104 Machine Organization & Programming Review Computer Science 104 Machine Organization & Programming Administrative 104/16 Processor Due today Final Sunday Dec 18, 2-5pm in D106 Today Ø high-level review Ø Q&A Alex will review sometime, watch

More information

CPSC 313, Winter 2016 Term 1 Sample Date: October 2016; Instructor: Mike Feeley

CPSC 313, Winter 2016 Term 1 Sample Date: October 2016; Instructor: Mike Feeley CPSC 313, Winter 2016 Term 1 Sample Date: October 2016; Instructor: Mike Feeley NOTE: This sample contains all of the question from the two CPSC 313 midterms for Summer 2015. This term s midterm will be

More information

Computer Organization: A Programmer's Perspective

Computer Organization: A Programmer's Perspective A Programmer's Perspective Instruction Set Architecture Gal A. Kaminka galk@cs.biu.ac.il Outline: CPU Design Background Instruction sets Logic design Sequential Implementation A simple, but not very fast

More information

CPSC 313, Summer 2013 Final Exam Date: June 24, 2013; Instructor: Mike Feeley

CPSC 313, Summer 2013 Final Exam Date: June 24, 2013; Instructor: Mike Feeley CPSC 313, Summer 2013 Final Exam Date: June 24, 2013; Instructor: Mike Feeley This is a closed-book exam. No outside notes. Electronic calculators are permitted. You may remove the last two pages of the

More information

For Tuesday. Finish Chapter 4. Also, Project 2 starts today

For Tuesday. Finish Chapter 4. Also, Project 2 starts today For Tuesday Finish Chapter 4 Also, Project 2 starts today 1 Sequential Y86 Implementation 1. Fetch From icode (4 bits) & ifun (4 bits) [valc (4bytes)] Calc valp 2. Decode: get ra [rb] [%esp] 3. Execute

More information

CS:APP Chapter 4 Computer Architecture Pipelined Implementation

CS:APP Chapter 4 Computer Architecture Pipelined Implementation CS:APP Chapter 4 Computer Architecture Pipelined Implementation Part II Randal. Bryant Carnegie ellon University http://csapp.cs.cmu.edu CS:APP Overview ata Hazards ake the pipelined processor work! Instruction

More information

Processor Architecture I. Alexandre David

Processor Architecture I. Alexandre David Processor Architecture I Alexandre David Overview n Introduction: from transistors to gates. n and from gates to circuits. n 4.1 n 4.2 n Micro+macro code. 12-04-2011 CART - Aalborg University 2 Evolution

More information

Systems I. Pipelining II. Topics Pipelining hardware: registers and feedback paths Difficulties with pipelines: hazards Method of mitigating hazards

Systems I. Pipelining II. Topics Pipelining hardware: registers and feedback paths Difficulties with pipelines: hazards Method of mitigating hazards Systems I Pipelining II Topics Pipelining hardware: registers and feedback paths ifficulties with pipelines: hazards Method of mitigating hazards Adding Pipeline Registers val, valm _icode, _valm rite

More information

CS:APP Guide to Y86 Processor Simulators

CS:APP Guide to Y86 Processor Simulators CS:APP Guide to Y86 Processor Simulators Randal E. Bryant David R. O Hallaron November 4, 2004 Copyright c 2002, R. E. Bryant, D. R. O Hallaron. All rights reserved. 1 This document describes the processor

More information

Intel x86-64 and Y86-64 Instruction Set Architecture

Intel x86-64 and Y86-64 Instruction Set Architecture CSE 2421: Systems I Low-Level Programming and Computer Organization Intel x86-64 and Y86-64 Instruction Set Architecture Presentation J Read/Study: Bryant 3.1 3.5, 4.1 Gojko Babić 03-07-2018 Intel x86

More information

CS:APP Chapter 4 Computer Architecture Wrap-Up Randal E. Bryant Carnegie Mellon University

CS:APP Chapter 4 Computer Architecture Wrap-Up Randal E. Bryant Carnegie Mellon University CS:APP Chapter 4 Computer Architecture Wrap-Up Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP Overview Wrap-Up of PIPE Design Performance analysis Fetch stage design Exceptional

More information

Michela Taufer CS:APP

Michela Taufer CS:APP ichela Taufer CS:APP Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and. O'Hallaron, Prentice Hall, 2003 Overview 2 CISC 360 Faʼ08 Pipeline Stages W_icode, W_val W

More information

Byte. cmovle 7 1. halt 0 0 addq 6 0 nop 1 0 subq 6 1 cmovxx ra, rb 2 fn ra rb andq 6 2 irmovq V, rb 3 0 F rb V xorq 6 3. cmovl 7 2.

Byte. cmovle 7 1. halt 0 0 addq 6 0 nop 1 0 subq 6 1 cmovxx ra, rb 2 fn ra rb andq 6 2 irmovq V, rb 3 0 F rb V xorq 6 3. cmovl 7 2. Y86-6 Instruc&on Set Computer rchitecture Sequen&al Implementa&on CSCI 202: Machine rchitecture and Organiza&on Byte 0 2 3 5 6 7 8 9 2 fn r rb irmovq V, rb 3 0 F rb V 0 r rb Pen- Chung Yew epartment Computer

More information

Computer Architecture I: Outline and Instruction Set Architecture. CENG331 - Computer Organization. Murat Manguoglu

Computer Architecture I: Outline and Instruction Set Architecture. CENG331 - Computer Organization. Murat Manguoglu Computer Architecture I: Outline and Instruction Set Architecture CENG331 - Computer Organization Murat Manguoglu Adapted from slides of the textbook: http://csapp.cs.cmu.edu/ Outline Background Instruction

More information

CS:APP Chapter 4 Computer Architecture Wrap-Up Randal E. Bryant Carnegie Mellon University

CS:APP Chapter 4 Computer Architecture Wrap-Up Randal E. Bryant Carnegie Mellon University CS:APP Chapter 4 Computer Architecture Wrap-Up Randal E. Bryant Carnegie Mellon University http://csapp.cs.cmu.edu CS:APP2e Overview Wrap-Up of PIPE Design Exceptional conditions Performance analysis Fetch

More information

administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions?

administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions? administrivia today start assembly probably won t finish all these slides Assignment 4 due tomorrow any questions? exam on Wednesday today s material not on the exam 1 Assembly Assembly is programming

More information

Second Part of the Course

Second Part of the Course CSC 2400: Computer Systems Towards the Hardware 1 Second Part of the Course Toward the hardware High-level language (C) assembly language machine language (IA-32) 2 High-Level Language g Make programming

More information

Process Layout and Function Calls

Process Layout and Function Calls Process Layout and Function Calls CS 6 Spring 07 / 8 Process Layout in Memory Stack grows towards decreasing addresses. is initialized at run-time. Heap grow towards increasing addresses. is initialized

More information

Midterm Exam CSC February 2009

Midterm Exam CSC February 2009 Midterm Exam CSC 252 26 February 2009 Directions; PLEASE READ This exam has 7 questions, all of which have subparts. Each question indicates its point value. The total is 90 points. Questions 3(d) and

More information

CSE2421 FINAL EXAM SPRING Name KEY. Instructions: Signature

CSE2421 FINAL EXAM SPRING Name KEY. Instructions: Signature CSE2421 FINAL EXAM SPRING 2013 Name KEY Instructions: This is a closed-book, closed-notes, closed-neighbor exam. Only a writing utensil is needed for this exam. No calculators allowed. If you need to go

More information

Datorarkitektur, 2009 Tentamen

Datorarkitektur, 2009 Tentamen Namn: Personnummer: Datorarkitektur, 2009 Tentamen 2009-03-13 Instructions: Make sure that your exam is not missing any sheets, then write your full name on the front. Write your answers in the space provided

More information

CS241 Computer Organization Spring 2015 IA

CS241 Computer Organization Spring 2015 IA CS241 Computer Organization Spring 2015 IA-32 2-10 2015 Outline! Review HW#3 and Quiz#1! More on Assembly (IA32) move instruction (mov) memory address computation arithmetic & logic instructions (add,

More information

bitwise (finish) / SEQ part 1

bitwise (finish) / SEQ part 1 bitwise (finish) / SEQ part 1 1 Changelog 1 Changes made in this version not seen in first lecture: 14 September 2017: slide 16-17: the x86 arithmetic shift instruction is sar, not sra last time 2 bitwise

More information

SEQ part 3 / HCLRS 1

SEQ part 3 / HCLRS 1 SEQ part 3 / HCLRS 1 Changelog 1 Changes made in this version not seen in first lecture: 21 September 2017: data memory value MUX input for call is PC + 10, not PC 21 September 2017: slide 23: add input

More information

Term-Level Verification of a Pipelined CISC Microprocessor

Term-Level Verification of a Pipelined CISC Microprocessor Term-Level Verification of a Pipelined CISC Microprocessor Randal E. Bryant December, 2005 CMU-CS-05-195 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 This work was supported

More information

CPSC 121: Models of Computation Lab #9: A Working Computer

CPSC 121: Models of Computation Lab #9: A Working Computer CPSC 121: Models of Computation Lab #9: A Working Computer Objectives In this lab, we revisit the Y86 processor, which you saw components of in labs 4 and 6. Recall that in lab 4, you learned about the

More information

CS61 Section Solutions 3

CS61 Section Solutions 3 CS61 Section Solutions 3 (Week of 10/1-10/5) 1. Assembly Operand Specifiers 2. Condition Codes 3. Jumps 4. Control Flow Loops 5. Procedure Calls 1. Assembly Operand Specifiers Q1 Operand Value %eax 0x104

More information

CSC 252: Processor Architecture

CSC 252: Processor Architecture S 252: Processor rchitecture Hardware omponents of a omputer System Processor atapath ontrol Input and Output devices 2/21/2008 1 2/21/2008 2 The Principle of bstraction Grouping principle Levels/layers

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College February 9, 2016 Reading Quiz Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between

More information

SOEN228, Winter Revision 1.2 Date: October 25,

SOEN228, Winter Revision 1.2 Date: October 25, SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003 1 Contents Flags Mnemonics Basic I/O Exercises Overview of sample programs 2 Flag Register The flag register stores the condition flags that retain

More information

Process Layout, Function Calls, and the Heap

Process Layout, Function Calls, and the Heap Process Layout, Function Calls, and the Heap CS 6 Spring 20 Prof. Vern Paxson TAs: Devdatta Akhawe, Mobin Javed, Matthias Vallentin January 9, 20 / 5 2 / 5 Outline Process Layout Function Calls The Heap

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College September 25, 2018 Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between programmer

More information

CPSC 313, Summer 2013 Final Exam Solution Date: June 24, 2013; Instructor: Mike Feeley

CPSC 313, Summer 2013 Final Exam Solution Date: June 24, 2013; Instructor: Mike Feeley CPSC 313, Summer 2013 Final Exam Solution Date: June 24, 2013; Instructor: Mike Feeley 1 (10 marks) This question is concerned with the general principles of pipelining, dependencies and hazards. First,

More information

Machine-Level Programming II: Control and Arithmetic

Machine-Level Programming II: Control and Arithmetic Machine-Level Programming II: Control and Arithmetic CSCI 2400: Computer Architecture Instructor: David Ferry Slides adapted from Bryant & O Hallaron s slides 1 Today Complete addressing mode, address

More information

CS 3330: SEQ part September 2016

CS 3330: SEQ part September 2016 1 CS 3330: SEQ part 2 15 September 2016 Recall: Timing 2 compute new values between rising edges compute compute compute compute clock signal registers, memories change at rising edges next value register

More information

CISC 360 Midterm Exam - Review Alignment

CISC 360 Midterm Exam - Review Alignment CISC 360 Midterm Exam - Review Alignment Michela Taufer October 14, 2008 Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective, R. Bryant and D. O'Hallaron, Prentice Hall, CS:APP 2003

More information

Program Exploitation Intro

Program Exploitation Intro Program Exploitation Intro x86 Assembly 04//2018 Security 1 Univeristà Ca Foscari, Venezia What is Program Exploitation "Making a program do something unexpected and not planned" The right bugs can be

More information

3 (5 marks) RISC instruction sets do not allow an ALU operation (e.g., addl) to read from memory. 2a Why is the memory stage after the execute stage?

3 (5 marks) RISC instruction sets do not allow an ALU operation (e.g., addl) to read from memory. 2a Why is the memory stage after the execute stage? CPSC 313, Winter 2016 Term 1 Sample Solution Date: October 2016; Instructor: Mike Feeley 1 (5 marks) The classic RISC pipeline we are studying consists of 5 stages. Briefly explain the role of each stage

More information

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site)

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) Function Calls COS 217 Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) 1 Goals of Today s Lecture Finishing introduction to assembly language o EFLAGS register

More information

Assembly Language: Function Calls

Assembly Language: Function Calls Assembly Language: Function Calls 1 Goals of this Lecture Help you learn: Function call problems: Calling and returning Passing parameters Storing local variables Handling registers without interference

More information

CS241 Computer Organization Spring Addresses & Pointers

CS241 Computer Organization Spring Addresses & Pointers CS241 Computer Organization Spring 2015 Addresses & Pointers 2-24 2015 Outline! Addresses & Pointers! leal - load effective address! Condition Codes & Jumps! conditional statements: if-then-else! conditional

More information

Assembly I: Basic Operations. Jo, Heeseung

Assembly I: Basic Operations. Jo, Heeseung Assembly I: Basic Operations Jo, Heeseung Moving Data (1) Moving data: movl source, dest Move 4-byte ("long") word Lots of these in typical code Operand types Immediate: constant integer data - Like C

More information

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb mrmovq D(rB), ra 5 0 ra rb OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest

cmovxx ra, rb 2 fn ra rb irmovq V, rb 3 0 F rb V rmmovq ra, D(rB) 4 0 ra rb mrmovq D(rB), ra 5 0 ra rb OPq ra, rb 6 fn ra rb jxx Dest 7 fn Dest Instruction Set Architecture Computer Architecture: Instruction Set Architecture CSci 2021: Machine Architecture and Organization Lecture #16, February 24th, 2016 Your instructor: Stephen McCamant Based

More information

ASSEMBLY I: BASIC OPERATIONS. Jo, Heeseung

ASSEMBLY I: BASIC OPERATIONS. Jo, Heeseung ASSEMBLY I: BASIC OPERATIONS Jo, Heeseung MOVING DATA (1) Moving data: movl source, dest Move 4-byte ("long") word Lots of these in typical code Operand types Immediate: constant integer data - Like C

More information

Credits to Randy Bryant & Dave O Hallaron

Credits to Randy Bryant & Dave O Hallaron Mellon Machine Level Programming II: Arithmetic & Control Lecture 4, March 10, 2011 Alexandre David Credits to Randy Bryant & Dave O Hallaron from Carnegie Mellon 1 Today Complete addressing mode, address

More information

Sungkyunkwan University

Sungkyunkwan University - 2 - Complete addressing mode, address computation (leal) Arithmetic operations Control: Condition codes Conditional branches While loops - 3 - Most General Form D(Rb,Ri,S) Mem[ Reg[ R b ] + S Reg[ R

More information

Assembly Language: Function Calls" Goals of this Lecture"

Assembly Language: Function Calls Goals of this Lecture Assembly Language: Function Calls" 1 Goals of this Lecture" Help you learn:" Function call problems:" Calling and returning" Passing parameters" Storing local variables" Handling registers without interference"

More information

Assembly I: Basic Operations. Computer Systems Laboratory Sungkyunkwan University

Assembly I: Basic Operations. Computer Systems Laboratory Sungkyunkwan University Assembly I: Basic Operations Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Moving Data (1) Moving data: movl source, dest Move 4-byte ( long )

More information

System Programming and Computer Architecture (Fall 2009)

System Programming and Computer Architecture (Fall 2009) System Programming and Computer Architecture (Fall 2009) Recitation 2 October 8 th, 2009 Zaheer Chothia Email: zchothia@student.ethz.ch Web: http://n.ethz.ch/~zchothia/ Topics for Today Classroom Exercise

More information

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017 CS 31: Intro to Systems ISAs and Assembly Martin Gagné Swarthmore College February 7, 2017 ANNOUNCEMENT All labs will meet in SCI 252 (the robot lab) tomorrow. Overview How to directly interact with hardware

More information

Giving credit where credit is due

Giving credit where credit is due CSC 230J Computer Organization Processor rchitecture V: aking the Pipelined Implementation ork r. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csc230j Giving credit where credit

More information

Assembly Language: Function Calls" Goals of this Lecture"

Assembly Language: Function Calls Goals of this Lecture Assembly Language: Function Calls" 1 Goals of this Lecture" Help you learn:" Function call problems:" Calling and urning" Passing parameters" Storing local variables" Handling registers without interference"

More information

Compiler Construction D7011E

Compiler Construction D7011E Compiler Construction D7011E Lecture 8: Introduction to code generation Viktor Leijon Slides largely by Johan Nordlander with material generously provided by Mark P. Jones. 1 What is a Compiler? Compilers

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: October 11, 2017 at 17:42 CS429 Slideset 6: 1 Topics of this Slideset

More information