Chapter 04: Instruction Sets and the Processor organizations. Lesson 11: Generation of Memory Addresses and Addressing Modes

Similar documents
Lecture 04: Machine Instructions

add R1,x add R1,500 add R1,[x] The answer is: all of these instructions implement adding operation on R1 and all of them have two addresses.

2. ADDRESSING METHODS

PESIT Bangalore South Campus

Chapter 04: Instruction Sets and the Processor organizations. Lesson 08: Processor Instructions - Part 1

COMPUTER ORGANIZATION & ARCHITECTURE

Introduction to Computer. Chapter 5 The LC-3. Instruction Set Architecture

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

Chapter 3 Machine Instructions & Programs. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 11. Instruction Sets: Addressing Modes and Formats. Yonsei University

ก AVR Microcontrollers

Principles of Compiler Design

COMP2121: Microprocessors and Interfacing. Instruction Formats and Addressing Modes

SISTEMI EMBEDDED. Computer Organization Central Processing Unit (CPU) Federico Baronti Last version:

CSCE 5610: Computer Architecture

Lecture 11: Control Unit and Instruction Encoding

Computer Organization & Assembly Language Programming. CSE 2312 Lecture 15 Addressing and Subroutine

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture

Load -- read data from memory to register. Store -- write data from register to memory. Load effective address -- compute address, save in register

PESIT Bangalore South Campus

Microcontroller Intel [Instruction Set]

Instruction Sets: Characteristics and Functions Addressing Modes

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2

Logistics. IIT CS 350 S '17 - Hale

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Analysis of the M6809 instruction set

EEL 5722C Field-Programmable Gate Array Design

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture

Computer System Architecture

Computing Layers. Chapter 5 The LC-3

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

LC-3. 3 bits for condition codes (more later) Fixed-length instructions, with 4-bit opcodes. IIT CS 350 S 18- Hale

Lecture 20: AVR Programming, Continued. AVR Program Visible State (ones we care about for now)

Computer. Organization. Design. vishnu 1

AVR ISA & AVR Programming (I)

Microcontroller. Instruction set of 8051

AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30]

Chapter Family Microcontrollers Instruction Set

Machine Language and Assembly Language

CN310 Microprocessor Systems Design

DEVICE DRIVERS AND TERRUPTS SERVICE MECHANISM Lesson-15: Writing Device Driving ISRs in a System

Computer Architecture and Organization. Instruction Sets: Addressing Modes and Formats

AVR ISA & AVR Programming (I) Lecturer: Sri Parameswaran Notes by: Annie Guo

COMP3221: Microprocessors and Embedded Systems

EC 333 Microprocessor and Interfacing Techniques (3+1)

Chapter 4: Data Movement Instructions. 4 1 MOV Revisited

Machine and Assembly Language Principles

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

Chapter 04: Instruction Sets and the Processor organizations. Lesson 20: RISC and converged Architecture

Course Administration

55:132/22C:160, HPCA Spring 2011

THE MICROPROCESSOR Von Neumann s Architecture Model

Updated Exercises by Diana Franklin

SECTION 5 ADDRESS GENERATION UNIT AND ADDRESSING MODES

Computer Organization CS 206 T Lec# 2: Instruction Sets

RTN (Register Transfer Notation)

Addressing Modes. Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

Chapter 2 Instruction Set Architecture

Computer Architecture

Addressing Modes. To review data transfer instructions and applying the more advanced addressing modes.

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

We briefly explain an instruction cycle now, before proceeding with the details of addressing modes.

Chapter 9. Programming Framework

68000 Architecture, Data Types and Addressing Modes. 9/20/6 Lecture 2 - Prog Model 1

COSC121: Computer Systems: Review

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Computer Architecture 1 ح 303

CISC Processor Design

Instruction Set Architecture

Programming of 8085 microprocessor and 8051 micro controller Study material

CS2214 COMPUTER ARCHITECTURE & ORGANIZATION SPRING 2014

INSTRUCTION SET OF 8085

IA-32 CSE 5302 Spring 2011 Ngoc Tam Tran

Machine Language, Assemblers and Linkers"

Faculty of Engineering Systems & Biomedical Dept. First Year Cairo University Sheet 6 Computer I

LC-3 Instruction Set Architecture

ECED3204: Microprocessor Part I--Introduction

(2) Explain the addressing mode of OR What do you mean by addressing mode? Explain diff. addressing mode for 8085 with examples.

ECE 375 Computer Organization and Assembly Language Programming Winter 2018 Solution Set #2

Chapter 2. Instruction Set Design. Computer Architectures. software. hardware. Which is easier to change/design??? Tien-Fu Chen

SOME ASSEMBLY REQUIRED

STRUCTURE OF DESKTOP COMPUTERS


Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:

DR bit RISC Microcontroller. Instructions set details ver 3.10

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

SEE 3223 Microprocessors. 4: Addressing Modes. Muhammad Mun im Ahmad Zabidi

Chapter Three Addressing Mode MOV AX, BX

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Annie Lin, Mohit Verma

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

8085 INSTRUCTION SET INSTRUCTION DETAILS

SN8F5000 Family Instruction Set

Homework 2. Lecture 6: Machine Code. Instruction Formats for HW2. Two parts: How to do Homework 2!!!!

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats

Transfer of Control. Lecture 10 JMP. JMP Formats. Jump Loop Homework 3 Outputting prompts Reading single characters

5008: Computer Architecture HW#2

TYPES OF INTERRUPTS: -

CHAPTER 5 A Closer Look at Instruction Set Architectures

Transcription:

Chapter 04: Instruction Sets and the Processor organizations Lesson 11: Generation of Memory Addresses and Addressing Modes 1

Objective Learn how a memory address generates in different addressing modes 2

Memory address generation 3

Operand in the instructions of instruction set An operand of an instruction is either at a register or is the immediate operand (part of instruction after the opcode bits or at a memory address 4

Addressing mode in an instruction set To compute the source or destination address of the operands 5

CISC Many addressing modes for computing the memory addresses 6

Need to compute the address of the operands Memory addresses when completely and directly addressed makes the instruction long (i) Suppose 32-bits address is directly specified in the two operands of an instruction, the instruction will become more than 64 bits 7

Need to compute the address of the operands (ii) Further, many a times, the address needs to be varied, for example, in processing data at a table In the table, operand address computes from table base address, row number data and column number data 8

Addrerssing mode 9

Addressing Modes Earlier discussed four modes (i) Register [Syntax ri, Address ri,] (ii) Memory direct or absolute [Syntax M [addr i ], Address addr j.] (iii) Register indirect memory [Syntax r i {M [addr j ]} or simply (r i ), Address addr j pointed by value in r i ] and (iv) Immediate operand [Syntax #data_value, Operand data_value.] 10

Examples (i) MOV r1, r4; ADD r1, r4; (ii) LD r4, M [0x1300 0000]; ST M [0x1300 0000], r0; ST M [0x1300 0004], r4 11

ST (r2), r1 r1 is also a 32-bit register First the instruction I is fetched in a read cycle k from an address i after PC i Then in a write cycle k + 1, the register r1 bits are transferred to addresses j to j +3, address j pointed by the register r2 12

Examples of modes (iii) ST (r2), r1; where r1 is also a 32- bit register. First the instruction I is fetched in a read cycle k from an address i after PC i. Then in a write cycle k + 1, the register r1 bits are transferred to addresses j to j +3, because address j pointed by the register r2 (iv) LD r4, #0x100; 13

Fifth Other Addressing Mode (v) Index [Syntax x(ri), Address ri + x,] and [Syntax (ri), Address ri] when offset = 0 14

LD 0x80(r4)? Assume r4 is 0x13000 0x80 is the displacement defined at the instruction Address referenced by the instruction is 0x13000 0x80 15

Index addressing mode Label plus immediate addressing mode adds the value of the immediate to the value of the register to get the destination address Adding 0x80 to 0x13000 gives 0x12F80, the address referenced by during the load instruction r4 unchanged. 16

Sixth Other Addressing Mode (vi) Base-Index [Syntax (ri, rj), Address ri + rj] 17

Seventh Other Addressing Mode (vii) Base-Index Offset [Syntax x (ri, rj), Address ri + rj + x] 18

Example Base Index LD r0, (r8, r9) Base Index 19

Example Base-Index Relative LD r0, 32(r8, r9) Displacement Base Index 20

Eight Other Addressing Mode (viii) Relative addressing [Syntax rel or x(pc), Address PC + rel or PC + x] 21

BR label, rel Assume: The linker calculates the offset from the branch instruction, label rel = 0x437 bytes 22

Target addresses Target address of the branch = Sum of the address of the branch (the PC when the branch executes) and the offset Assume the branch instruction loaded info at address 0x4000 Target address is 0x4437 (0x4000 + 0x437) When the branch is loaded into address 0x4400, the target address is 0x4837. 23

Ninth Other Addressing Mode (ix) Auto-decrement or auto predecrement first decrement a register, then use a register indirect [Syntax (ri), Address ri 1 L] L the length of the each memory word in bytes 24

Tenth Other Addressing Mode (x) Auto-increment or auto post-increment use a register indirect and then increment a register for accessing next word at memory in later instruction [Syntax (ri)+, Address ri +1 l] 25

Auto post Increment Syntax (ri)+ address is ri in present instruction, but will be ri +1 l in next time use of ri as ri post increments l = is the word length in bytes 26

Post Increment Offset Addressing Post increment offset addressing using ST x[r2], r1 Instruction 27

Different architectures using different syntaxes Post-increment addressing an architect may have the separate instructions for post-incrementing and non post-incrementing addressing modes 28

Summary 29

We learnt Memory address generation in different addressing modes Base Base Relative Index Index Relative 30

We learnt Base-Index Base-Index Relative Auto Post Increment Auto Predecrement 31

End of Lesson 11 on Generation of Memory Addresses and Addressing Modes 32