Overview The Operate Instructions - ADD, AND, NOT The Data Movement Instructions - Load, Load Address, Store Example Using Operate & Data Movement The.

Slides:



Advertisements
Similar presentations
Chapter 5 The LC-3.
Advertisements

Chapter 7 Introduction to LC-3 Assembly Language Assembly Language Assembly Process Using the Editor & Simulator for Assembly Language Programming.
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
PART 6 Programming 1.Decomposition 2.Three Constructs 3.Counting Example 4.Debugging.
Chapter 5 The LC-3 Instruction Set Architecture l ISA Overview l Operate instructions l Data Movement instructions l Control Instructions l LC-3 data path.
CS25410 Memory Machine Code. Common types of non-rotating memory (1) RAMRandom Access Memory In reality, read/write memory This is usually volatile, meaning.
Chapter 5 The LC-3.
Chapter 4 - ISA 1.The Von Neumann Model. 4-2 The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer.
LC-3 Computer LC-3 Instructions
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
Overview Program in LC-3 machine language Use the Editor
Some thoughts: If it is too good to be true, it isn’t. Success is temporary. It is hard work to make it simple. Knowing you did it right is enough reward.
Overview Review Trap Instruction Program in LC-3 machine language Use LC-3 Simulator.
LC-3 Instruction Set Architecture (Textbook’s Chapter 5)
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Chapter 6 Programming in Machine Language The LC-3 Simulator
Chap 4 & 5 LC-3 Computer LC-3 Instructions Chap 4 Homework – due Monday October 27 Chap 5 Homework – due Wednesday October 29 Project 2 Designs (Working.
S. Barua – CPSC 240 CHAPTER 9 TRAP ROUTINES AND SUBROUTINES The TRAP mechanism allows the user program.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
LC-3 Instruction Set Architecture
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 5 The LC-2 Instruction Set Architecture Operate instructions Data Movement instructions.
TCSS 490A Topics in Computing & Software Systems “Introduction to Computer Systems”
Chapter 4 The Von Neumann Model
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 Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Data Movement Instructions Load --
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA = All of the.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Introduction to Computing Systems and Programming The LC-2.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Computer Science 210 Computer Organization Machine Language Instructions: Control.
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
COSC121: Computer Systems: Review
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
The LC-3 Instruction Set Architecture Data Movement instructions
The Processor and Machine Language
Introduction to Computer Engineering
LC-3 Details and Examples
Chapter 5 The LC-3 An Hong 2018 Fall
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Introduction to Computer Engineering
Introduction to Computer Engineering
Computer Science 210 Computer Organization
Sequencing, Selection, and Loops in Machine Language
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Chapter 9 TRAP Routines and Subroutines
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Chapter 6 Programming.
Chapter 5 The LC-3.
Presentation transcript:

Overview The Operate Instructions - ADD, AND, NOT The Data Movement Instructions - Load, Load Address, Store Example Using Operate & Data Movement The Control instructions - BR, JMP, TRAP

Example AddressInstructionComments x30F R1  PC – 3 = x30F4 x30F R2  R = x3102 x30F M[PC - 5]  R2 M[x30F4]  x3102 x30F R2  0 x30FA R2  R2 + 5 = 5 x30FB M[R1+14]  R2 M[x3102]  5 x30FC R3  M[M[x30F4]] R3  M[x3102] R3  5 Opcode

Branch Instruction BR [0000 nzp PCoffset9] Branch specifies one or more condition codes If the set bit is specified, the branch is taken: –PC is set to the address specified in the instruction –Target address is made by adding SEXT(IR[8:0]) to the PC If the branch is not taken: - the next sequential instruction (PC) is executed.

BR ///////////// /////+ SEXT

Jump Instruction JMP BaseR [ BaseR ] Jump is an unconditional branch -- always taken. Base –Address is contents of the register –Allows any target address.

TRAP Calls a service routine, identified by 8-bit “trap vector.” When routine is done, PC is set to the instruction following TRAP. vectorroutine x23input a character from the keyboard x21output a character to the monitor x25halt the program

LC-3 Memory Map

TRAPS

Using Branch Instructions Compute sum of 12 integers. Numbers start at location x3100. Program starts at location x3000. R1  x3100 R3  0 R2  12 R2=0? R4  M[R1] R3  R3+R4 R1  R1+1 R2  R2-1 NO YES

Sample Program AddressInstructionComments x R1  x3100 (PC+0xFF) x R3  0 x R2  0 x R2  12 x If Z, goto x300A (PC+5) x Load next value to R4 x Add to R3 x Increment R1 (pointer) X Decrement R2 (counter) x Goto x3004 (PC-6)

Example 1: Multiply This program multiplies two unsigned integers in R4 and R5. x x x x x clear R2 add R4 to R2 decrement R5 R5 = 0? HALT No Yes R2 <- 0 R2 <- R2 + R4 R5 <- R5 – 1 BRzp x3201 HALT