Second word first word Figure 2.5. Memory words. n bits last word i th word.

Slides:



Advertisements
Similar presentations
Instruction execution and sequencing
Advertisements


Assembly Language Programming
Addressing Modes (Week4)
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
Memory Locatıons and Addresses (Week 3)
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
Chapter 5 The LC-3.
LC-3 Computer LC-3 Instructions
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
Execution of an instruction
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Assembly Language for Intel-Based Computers Chapter 2: IA-32 Processor Architecture Kip Irvine.
Chapter 6 Programming in Machine Language The LC-3 Simulator
Chapter
State Machines Used to Design Sequential Circuits.
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Pentium Addressing Modes
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
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
Part II: Addressing Modes
MIPS Instruction Set Advantages
Assembly & Machine Languages
ADDING INTEGERS Positive + Positive = Positive Positive + Positive = Positive ( +3) + (+2) = +5 ( +3) + (+2) = +5 When a number is positive, you do not.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA.
Module 10 Adapted By and Prepared James Tan © 2001.
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.
Memory and Addressing How and Where Information is Stored.
Registers and MAL Lecture 12. The MAL Architecture MAL is a load/store architecture. MAL supports only those addressing modes supported by the MIPS RISC.
Chapter 2-3 Addressing Modes
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 --
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
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.
Execution of an instruction
55:035 Computer Architecture and Organization Lecture 2.
Introduction to Computer Organization and Architecture Lecture 2 By Juthawut Chantharamalee wut_cha/home.htm.
Computer Architecture Lecture 03 Fasih ur Rehman.
In1210/01-PDS 1 TU-Delft Instructions and addressing.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
The x86 Instruction Set Lecture 16 Mon, Mar 14, 2005.
An Example Architecture. A Paper Computer - Woody Woody's characteristics Word size – 8 bits One word.
Topics covered: Instruction Set Architecture CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Addressing Modes and Formats
Addressing Modes. Register Addressing Immediate Addressing Base Addressing Indexed Addressing PC-Relative Addressing.
Arrays in MIPS Assembly Computer Organization and Assembly Language: Module 6.
The LC-3 – Chapter 5 COMP 2620 Dr. James Money COMP
Computer Organization Instructions Language of The Computer (MIPS) 2.
CPS 4150 Computer Organization Chapter 2-2 Fall 2006 Ching-Song Don Wei.
1 Pertemuan 5 Bahasa Rakitan: I Matakuliah: T0324 / Arsitektur dan Organisasi Komputer Tahun: 2005 Versi: 1.
1 ADDRESSING MODES Addressing Modes: * Specifies a rule for interpreting or modifying the address field of the instruction (before the operand is actually.
1 Instructions and Addressing Course website:
1 CSCI 2510 Computer Organization Memory Addressing and Assembly Instruction Basics.
Chapter 2. Machine Instructions and Programs
Addressing Modes in Microprocessors
Chapter 11 Instruction Sets
8051 Addressing Modes The way, using which the data source or destination addresses are specified in the instruction mnemonic for moving the data, is.
Microcomputer Programming
Computer Organization and Assembly Language (COAL)
ECE 445 CS1251 Computer Organization Carl Hamacher
Figure 2.1. Binary, signed-integer representations.
Computer Science 210 Computer Organization
Chapter 1. Basic Structure of Computers
Passing Parameters Data passed to a subroutine is called a parameter.
Introduction to Micro Controllers & Embedded System Design
CNET 315 Microprocessor & Assembly Language
Presentation transcript:

second word first word Figure 2.5. Memory words. n bits last word i th word

Figure 2.6. Examples of encoded information in a 32-bit word. (b) Four characters character (a) A signed integer Sign bit: for positive numbers for negative numbers ASCII 32 bits 8 bits b 31 b 30 b 1 b 0 b 31 0= b 1=

R0,C B,R0 A,R0 Move i + 8 Begin execution hereMove i ContentsAddress C B A the program Data for segment program 3-instruction Add i + 4 Figure 2.8. A program for C  + 

NUMn NUM2 NUM1 R0,SUM NUMn,R0 NUM3,R0 NUM2,R0 NUM1,R0 Figure 2.9. A straight-line program for adding n numbers. Add Move SUM i Move Add i 4n + i 4n4-+ i8+ i4+

N,R1Move NUMn NUM2 NUM1 R0,SUM R1 "Next" number to R0 Figure Using a loop to add n numbers. LOOP Decrement Move LOOP loop Program Determine address of "Next" number and add N SUM n R0Clear Branch>0

R1 Add (R1),R0Add (A),R0 Figure Indirect addressing. Register BB Operand memory Main (a) Through a general-purpose register(b) Through a memory location ABOperandB

ClearR0 Contents Move Add Decrement Add LOOP Initialization LOOP Address Figure Use of indirect addressing in the program of Figure (R2),R0 #4,R2 R1 R0,SUM Move N,R1 #NUM1,R2 Branch>0

Operand1020 Figure Indexed addressing. Add 1000(R1),R2 R1 Add 20(R1),R2 Operand = offset 1000 (a) Offset is given as a constant (b) Offset is in the index register

Figure A list of students' marks. Student 1 Student 2 Test 3 Test 2 Test 1 Student ID Test 3 Test 2 Student ID n N LIST Test 1LIST + 4 LIST + 8 LIST + 12 LIST + 16

Move #LIST,R0 Add Move Add 12(R0),R3 LOOP Figure Indexed addressing used in accessing test scores in the list in Figure #16,R0 ClearR1 ClearR3 4(R0),R1 ClearR2 Add8(R0),R2 N,R4 Add DecrementR4 LOOP MoveR1,SUM1 Move R2,SUM2 MoveR3,SUM3 Branch>0

R0Clear R0,SUM R1 (R2)+,R0 Figure The Autoincrement addressing mode used in the program of Figure Initialization Move LOOPAdd Decrement LOOP #NUM1,R2 N,R1Move Branch>0

NUM2 NUMn NUM1 R0Clear R0,SUM R1 #4,R2 (R2),R0 Figure Memory arrangement for the program in Figure SUM N LOOP Decrement Add Move #NUM1,R2 N,R1Move Branch>0

MemoryAddressing addressordata labelOperationinformation AssemblerdirectivesSUMEQU200 ORIGIN204 NDATAWORD100 NUM1RESERVE400 ORIGIN100 StatementsthatSTARTMOVEN,R1 generateMOVE#NUM1,R2 machineCLRR0 instructionsLOOPADD(R2),R0 ADD#4,R2 DECR1 BGTZLOOP MOVER0,SUM AssemblerdirectivesRETURN ENDSTART Figure Assembly language representation for the program in Figure 2.17.

Move#LOC,R0InitializepointerregisterR0topointtothe addressofthefirstlocationinmemory wherethecharactersaretobestored. READTestBit#3,INSTATUSWaitforacharactertobeentered Branch=0READinthekeyboardbufferDATAIN. MoveByteDATAIN,(R0)TransferthecharacterfromDATAINinto thememory(thisclearsSINto0). ECHOTestBit#3,OUTSTATUSWaitforthedisplaytobecomeready. Branch=0ECHO MoveByte(R0),DATAOUTMovethecharacterjustreadtothedisplay bufferregister(thisclearsSOUTto0). Compare#CR,(R0)+CheckifthecharacterjustreadisCR (carriagereturn).IfitisnotCR,then Branch 00 READbranchbackandreadanothercharacter. Also,incrementthepointertostorethe nextcharacter. Figure A program that reads a line of characters and displays it.