ECE 445 CS1251 Computer Organization Carl Hamacher

Slides:



Advertisements
Similar presentations
Instruction execution and sequencing
Advertisements

Assembly Language Programming
Chapter 2 Instruction Set Architecture
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
SUPPLEMENTARY CHAPTER 2 Instruction Addressing Modes
Fall EE 333 Lillevik 333f06-l4 University of Portland School of Engineering Computer Organization Lecture 4 Assembly language programming ALU and.
LC-3 Computer LC-3 Instructions
Execution of an instruction
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Chapter
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Chapter 11 Instruction Sets: Addressing Modes and Formats HW: 11.4, 5, 13, 16 (Due 11/15)
1 Instructions and Addressing
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 5 The LC-2 Instruction Set Architecture Operate instructions Data Movement instructions.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
CSC Computer Organization Lecture 4: Machine Instructions and Programs Terrence Mak.
Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Lecture 15 Today’s lecture MARIE programming Assembler
Introduction to Computing Systems from bits & gates to C & beyond Chapter 5 The LC-3 Instruction Set Architecture ISA Overview Operate instructions Data.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Data Movement Instructions Load --
Execution of an instruction
Computer Architecture Lecture 03 Fasih ur Rehman.
In1210/01-PDS 1 TU-Delft Instructions and addressing.
Topics covered: Instruction Set Architecture CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Our programmer needs to do this !
Second word first word Figure 2.5. Memory words. n bits last word i th word.
MIPS Architecture Topics –What resources MIPS assembly manipulates –CPU (Central Processing Unit) –ALU (Arithmetic & Logical Unit), Registers –Memory –I/O.
Computer Organization Instructions Language of The Computer (MIPS) 2.
CPS 4150 Computer Organization Chapter 2-2 Fall 2006 Ching-Song Don Wei.
1 Instructions and Addressing Course website:
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
מבוסס על שקפים מאת יאן ציטרין
Chapter 2. Machine Instructions and Programs
ELEC 418 Advanced Digital Systems Dr. Ron Hayne
ELEC 418 Advanced Digital Systems Dr. Ron Hayne
General information CSE 243 : Introduction to Computer Architecture and Hardware /Software Interface. Instructor : Swapna S. Gokhale Phone :
Addressing Modes in Microprocessors
Chapter 11 Instruction Sets
Computer Science 210 Computer Organization
ECE 382 Lesson 4 Lesson Outline Readings
Machine Instructions and Programs contd:
William Stallings Computer Organization and Architecture 8th Edition
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
The LC-3 Instruction Set Architecture Data Movement instructions
The Processor and Machine Language
Computer Organization
Computer Organization
Computer Science 210 Computer Organization
Computer Structure S.Abinash 11/29/ _02.
Topic 6 LC-3.
Chapter 1. Basic Structure of Computers
Passing Parameters Data passed to a subroutine is called a parameter.
ECEG-3202 Computer Architecture and Organization
Computer Science 210 Computer Organization
68000 Architecture, Data Types and Addressing Modes
Conditional Jumps and Time Delays
Introduction to Micro Controllers & Embedded System Design
Computer Science 210 Computer Organization
Computer Architecture
Conditional Jumps and Time Delays
The Von Neumann Architecture Odds and Ends
Under Address Modes Source: under
Assembly Language Programming
Basic components Instruction processing
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
Chapter 5 The LC-3.
Presentation transcript:

ECE 445 CS1251 Computer Organization Carl Hamacher Addressing Modes CS1251 Computer Organization Carl Hamacher 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 Addressing Modes Name Syntax Addressing Function Immediate #Value Operand = Value Register Ri EA = Ri Absolute (Direct) LOC EA = LOC Indirect (Ri) (LOC) EA = [Ri] EA = [LOC] Index X(Ri) EA = [Ri] + X Relative X(PC) EA = [PC] + X Autoincrement (Ri)+ EA = [Ri]; Ri  [Ri] + 1 Autodecrement –(Ri) Ri  [Ri] – 1; EA = [Ri] EA = Effective Address 11/7/2018 Department of Information Technology RJH

Absolute, Register, Immediate ECE 445 Absolute, Register, Immediate Assembly Language MOVE NUM1,R1 MOVE #1,R2 ADD #1,R1 ADD R1,R2 Register Transfer Notation R1  [NUM1] R2  1 R1  1 + [R1] R2  [R1] + [R2] 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 Instruction Results MOVE #NUM2,R0 MOVE NUM1,R1 MOVE #5,R2 ADD #-1,R2 MEM REGS Label Addr Contents 0B NUM1 0C X"000A" NUM2 0D X"0007" 0E Addr Contents 1 2 3 X"000D" X"000A" X"0005" X"0004" 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 Indirect Addressing Assembly Language MOVE (R0),R2 MOVE (R1),NUM1 ADD (R3),R1 ADD #1,(R3) Register Transfer Notation R2  [MEM([R0])] MEM(NUM1)  [MEM([R1])] R1  [MEM([R3])] + [R1] MEM([R3])  1 + [MEM([R3])] 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 Instruction Results MOVE (R0),R2 MOVE (R1),NUM1 ADD #1,(R3) MEM REGS Label Addr Contents 12 NUM1 13 NUM2 14 X"0007" 15 X"0009" Addr Contents 1 2 3 X"0012" X"0003" X"0004" X"0014" X"0009" X"0015" X"0007" 11/7/2018 Department of Information Technology RJH

Loop to Add n Numbers MOVE N,R1 Counter CLEAR R0 Accumulator LOOP ECE 445 Loop to Add n Numbers MOVE N,R1 Counter CLEAR R0 Accumulator LOOP Determine address of "Next" number and add "Next" number to R0 Program loop DECREMENT R1 BRANCH>0 LOOP PC  [PC] + Offset (CC>0) MOVE R0,SUM . . . SUM N n NUM1 . . . NUMn 11/7/2018 Department of Information Technology RJH

Use of Indirect Addressing ECE 445 Use of Indirect Addressing MOVE N,R1 MOVE #NUM1,R2 CLEAR R0 LOOP ADD (R2),R0 ADD #1,R2 DECREMENT R1 BRANCH>0 LOOP MOVE R0,SUM R0 Accumulator R1 n Counter R2 NUM1 Pointer R3 SUM N n NUM1 . . . NUMn 11/7/2018 Department of Information Technology RJH

Indexed Addressing (Arrays) ECE 445 Indexed Addressing (Arrays) Assembly Language MOVE X(R0),R1 MOVE R2,Y(R3) ADD Z(R1),R2 Register Transfer Notation R1  [MEM(X + [R0])] MEM(Y + [R3])  [R2] R2  [MEM(Z + [R1])] + [R2] 11/7/2018 Department of Information Technology RJH

Assembly Language to Machine Instructions ECE 445 Assembly Language to Machine Instructions Assembler (Program) Source Program (Assembly Language) Object Program (Machine Instructions) Assembler Directives (Commands) How to Interpret Names Where to Place Instructions in Memory Where to Place Data in Memory 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 Assembler Directives START 100 MOVE N,R1 SUM EQU 200 ORIGIN 201 N DATAWORD 300 NUM1 RESERVE 300 ORIGIN 100 START MOVE N,R1 MOVE #NUM1,R2 CLR R0 LOOP ADD (R2),R0 ADD #1,R2 DEC R1 BGTZ LOOP MOVE R0,SUM RETURN END START 101 MOVE #NUM1,R2 102 CLEAR R0 LOOP 103 ADD (R2),R0 104 ADD #1,R2 105 DECREMENT R1 106 BRANCH>0 LOOP 107 MOVE R0,SUM . . . SUM 200 N 201 300 NUM1 202 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 Two-Pass Assembler First Pass Create Symbol Table Names Assigned Numerical Values Second Pass Translates Assembly Language to Machine Code Substitutes Values for Names Computes Branch Offsets 11/7/2018 Department of Information Technology RJH

Encoding of Machine Instructions ECE 445 Encoding of Machine Instructions Opcode Source Dest Other Info One-Word Instruction Opcode Source Dest Other Info Two-Word Instruction Memory Address / Immediate Operand Opcode Ri Other Info Three-Operand Instruction Rj Rk 11/7/2018 Department of Information Technology RJH

HW2 Instruction Encoding ECE 445 HW2 Instruction Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 OP SRC DST VALUE IR Assembly Language OP SRC, DST Example MOVE R1,R2 Register Transfer Notation DST  [SRC] OP [DST] Example R2  [R1] 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 HW2 Addressing Modes Mode REG # Name Syntax Addr Fn SRC 00 00-11 Register Direct Rn EA = Rn 01 Register Indirect (Rn) EA = [Rn] 10 XX Immediate #Value Operand = Value 11 Absolute Value EA = Value Mode REG # Name Syntax Addr Fn DST 00-11 Register Direct Rn EA = Rn 1 XX Absolute Value EA = Value EA = Effective Address 11/7/2018 Department of Information Technology RJH

Single-Bus Architecture ECE 445 Single-Bus Architecture BUS A 6 6 MAR 3 PC ROM MEM 1 MDR 2 IR 1 1 2 6 MUX MUX 2 Y 1 1 REGS A B ALU R Z 11/7/2018 Department of Information Technology RJH

SRC Control Flowchart Reg Direct 00 Reg Indir 01 Y  [REGS([SRC_REG])] ECE 445 SRC Control Flowchart Reg Direct 00 Reg Indir 01 N N Y Y Y  [REGS([SRC_REG])] MAR  [REGS([SRC_REG])] MDR  [MEM([MAR])] Y  [MDR] 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 SRC Control Flowchart Immediate 10 Absolute 11 N N Y Y Y  Value MAR  Value MDR  [MEM([MAR])] Y  [MDR] 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 DST Control Flowchart Reg Direct Absolute 1 N N Y Y REGS([DST_REG])  [Z] MAR  Value MDR  [Z] MEM([MAR])  [MDR] 11/7/2018 Department of Information Technology RJH

Department of Information Technology ECE 445 Questions? 11/7/2018 Department of Information Technology RJH