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.

Slides:



Advertisements
Similar presentations
Chapter 7 Introduction to LC-3 Assembly Language Assembly Language Assembly Process Using the Editor & Simulator for Assembly Language Programming.
Advertisements

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 The Operate Instructions - ADD, AND, NOT The Data Movement Instructions - Load, Load Address, Store Example Using Operate & Data Movement The.
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)
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Chapter 6 Programming in Machine Language The LC-3 Simulator
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Overview The von Neumann Machine - the programmable digital computer Introducing the LC-3 Computer - A “toy” computer for us to learn from Computer machine.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Chapter 4 H1 Assembly Language: Part 2. Direct instruction Contains the absolute address of the memory location it accesses. ld instruction:
Introduction to LC-3 Assembly Language
State Machines Used to Design Sequential Circuits.
TCSS 372A Computer Architecture. Getting Started Get acquainted (take pictures) Review Web Page (
LC-3 Instruction Set Architecture
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Computer Architecture
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
TCSS 372A Computer Architecture. Getting Started Get acquainted (take pictures) Purpose, scope, and expectations of the course Expectations & strategy.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Memory and Addressing How and Where Information is Stored.
Chapter 4 The Von Neumann Model
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 CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
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.
SSST: CS130 F. Hadziomerovic
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Introduction to Computing Systems and Programming The LC-2.
Click to edit Master title style Click to edit Master text styles – –Second level Third level – –Fourth level » »Fifth level 1 – –Second level Third level.
Chapter 5 Computer Organization TIT 304/TCS 303. Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can.
Computer Science 210 Computer Organization
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Data Representation – Instructions
The Processor and Machine Language
LC-3 Details and Examples
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Computer Science 210 Computer Organization
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Chapter 7 Assembly Language
LC-2: The Little Computer 2
CPU has 6 special locations called registers
Chapter 4: Computer Architecture
The Stored Program Computer
The Von Neumann Machine
Basic components Instruction processing
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
Hmmm Assembly Language
Chapter 5 The LC-3.
Presentation transcript:

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 Schematics) – due Wednesday October 29 Project 2 Reports – due Wednesday November 5 Note: Alt PrintScreen is a good way to get a 1 page schematic with timing traces Project 1 Feedback – I would like to see more clarification/discussion of what you did and observed, especially linking the timing traces to the circuits.

LC-3 Memory Map (64K of 16 bit words) 256 words 23.5 K words 39.5 K words 512 words

The LC-3 Computer a von Neumann machine Memory PSW (Program Status Word): Bits: | S| |Priority| | N| Z| P| PSW The Instruction Cycle Fetch: Next Instruction from Memory (PC)  (points to) next instruction PC  (PC) + 1 Decode: Fetched Instruction Evaluate: Instr & Address (es) (find where the data is) Fetch: Operand (s) (get data as specified) Execute: Operation Store: Result (if specified)

Computer Machine Instruction Formats What is IN an instruction? Operation code – what to do Input Operand(s) – where to get input operands (memory, registers) Output Operand(s) – Where to put results (memory, registers) What are the major instruction types? Data Movement (load, store, etc.) Operate (add, sub, mult, OR, AND, etc.) Control (branch, jump to subroutine, etc.)

LC-3 Instructions (Fig 5.3 – Appendix a) Addressing Modes Register (Operand is in one of the 8 registers) PC-relative (Operand is “offset” from where the PC points) Base + Offset (Base relative) (Operand is “offset” from the contents of a register) Immediate (Operand is in the instruction) Indirect (The “Operand” points to the real address of Operand – rather than being the operand)

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

TRAPS See page 543.

Example LC-3 Program Write a program to add 12 integers and store the result in a Register.

Compute the Sum of 12 Integers Program Program begins at location x3000. Integers begin at location x3100. R1  x3100 R3  0 (Sum) R2  12(count) R2=0? R4  M[R1] R3  R3+R4 R1  R1+1 R2  R2-1 NO YES R1: “Array” index pointer (Begin with location 3100) R3: Accumulator for the sum of integers R2: Loop counter (Count down from 12) R4: Temporary register to store next integer

Sum integers from x3100 – x310B AddressInstructionComments x R1  x3100 x R3  0 x R2  0 x R2  12 x If Z, goto x300A x Load next value to R4 x Add to R3 x Increment R1 (pointer) X Decrement R2 (counter) x Goto x3004 R1: “Array” index pointer (Begin with location 3100) R3: Accumulator for the sum of integers R2: Loop counter (Count down from 12) R4: Temporary register to store next integer

The Sum program in “binary” ;start x3000 x ;R1=x3100 x ;R3=0 x ;R2=0 x ;R2=R2+12 x ;If z goto x300A x ;Load next value into R4 x ;R3=R3+R4 x ;R1=R1+1 x ;R2=R2-1 x ;goto x3004 x300A ;halt

The Sum program in “hex” 3000 ;start x3000 x3000 E2FF ;R1=x3100 x E0 ;R3=0 x A0 ;R2=0 x AC ;R2=R2+12 x ;If z goto x300A x ;Load next value into R4 x C4 ;R3=R3+R4 x ;R1=R1+1 x BF ;R2=R2-1 x3009 0FFA ;goto x3004 x300A F025 ;halt

The Sum program Data in “hex” 3100 ; Begin data at x3100 x ; Loc x3100 x x x x3104 FFFF x3105 1C10 x B1 x x3108 0F07 x x310A 0A00 x310B 400F ; Loc x310B

LC3 Edit Enter (or Load) the program into LC3 Edit - Store it as prog.bin for a binary file, or Store it as prog.hex for a hex file - Create a prog.obj file with the Editor Enter (or Load) the data into LC3 Edit - Store it as data.bin for a binary file, or Store it as data.hex for a hex file - Create a data.obj file with the Editor

LC-3 Simulator Open LC-3 Simulator - Load prog.obj - Load data.obj - Set breakpoint(s) - Step through program

Simulator Screen

LC3 Edit