Addressing modes The way in which an operand is specified is called the Address Mode.

Slides:



Advertisements
Similar presentations
Registers of the 8086/ /2002 JNM.
Advertisements

There are two types of addressing schemes:
ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
Chapter 3 Addressing Modes
6-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 Addressing modes.
CM404.12TO131 Name : C. S. Manjula, Grad IETE Designation : Lab Mechanic Branch: Computer Engineering Institute: S.P.W. Polytechnic, Tirupati, Semester:
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
Azir ALIU 1 What is an assembly language?. Azir ALIU 2 Inside the CPU.
Data Movement Instructions
Addressing modes – 1 The way in which an operand is specified is called the Address Mode.
The 8086 Assembly Programming Data Allocation & Addressing Modes
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
Microprocessor Systems Design I
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 7: More on Addressing Modes, Structures, and Stack Constantine D. Polychronopoulos Professor, ECE.
Dr. José M. Reyes Álamo 1.  The 80x86 memory addressing modes provide flexible access to memory, allowing you to easily access ◦ Variables ◦ Arrays ◦
3.7 String Instructions Specifying the Operands’ Size and Address and the String Direction STRING = a data collection in memory. String ELEMENTS can be:
1/2002JNM1 Positional Notation (Hex Digits). 1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR1 Addressing Mode.
Types of Registers (8086 Microprocessor Based)
Chapter 4 - Implementing Standard Program Structures in 8086 Assembly Language from Microprocessors and Interfacing by Douglas Hall.
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Faculty of Engineering, Electrical Department,
4-Oct Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept  direct mode: OK for static addresses  indirect register mode:
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
ΠΟΛΥΤΕΧΝΙΚΗ ΣΧΟΛΗ Τμήμα Ηλεκτρολογών Μηχανικών και Τεχνολογίας Υπολογιστών Μικρουπολογιστές & Μικροσυστήματα ΙΙ Καθηγητής Σταύρος Α. Κουμπιάς Πανεπιστημίου.
8086 Internal Architecture
ECE291 Computer Engineering II Lecture 3 Josh Potts University of Illinois at Urbana- Champaign.
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
Addressing Modes. Addressing Mode The data is referred as operand. The operands may be contained in registers, memory or I/O ports, within the instruction.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Assembly Language Data Movement Instructions. MOV Instruction Move source operand to destination mov destination, source The source and destination are.
Internal Programming Architecture or Model
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
Addressing Modes Dr. Hadi Hassan.  Two Basic Questions  Where are the operands?  How memory addresses are computed?  Intel IA-32 supports 3 fundamental.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Addressing Modes Instruction – Op-code – Operand Addressing mode indicates a way of locating data or operands. – Any instruction may belong to one or more.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Instruction set Architecture
Microprocessor Systems Design I
A Closer Look at Instruction Set Architectures
Introduction to 8086 Microprocessor
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
ADDRESSING MODES.
Microprocessor and Assembly Language
EE3541 Introduction to Microprocessors
Assembly IA-32.
ADDRESSING MODES.
Assembly Lang. – Intel 8086 Addressing modes – 1
Chapter 3 Addressing Modes
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Microprocessor and Assembly Language
Symbolic Instruction and Addressing
Data Addressing Modes • MOV AX,BX; This instruction transfers the word contents of the source-register(BX) into the destination register(AX). • The source.
8086 Registers Module M14.2 Sections 9.2, 10.1.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Symbolic Instruction and Addressing
(Array and Addressing Modes)
CNET 315 Microprocessor & Assembly Language
Lecture 06 Programming language.
Data Movement Instructions
Chapter 6 –Symbolic Instruction and Addressing
Intel 8086.
Chapter 8: Instruction Set 8086 CPU Architecture
(Array and Addressing Modes)
Presentation transcript:

Addressing modes The way in which an operand is specified is called the Address Mode.

8086 AM

Marut – Based & Indexed AM Offset address is obtained by adding a number called displacement to the contents of a register. Displacement  – Offset address of a variable – A constant +/- – The offset address of a variable +/- a const.

Syntax of an operand~ [reg. + displacement] [displacement + reg] [reg] + displ dipl. + [reg.] displ[reg] Reg. must be  BX, SI or DI  DS contains the segment no. of the operand’s address  BP  SS has the segment no.

Based/Indexed AM is Based  if BX (base reg) or, BP (base pointer) is used. AM is indexed  if SI (source index) or, DI (destination index) is used. e.g., W is a word array, BX contains 4. MOVAX, W[BX]  The displacement is the offset address of variable W.  The instruction moves the element at address W+4 to AX. This is the 3 rd element in the array.

Other forms of previous example… – MOVAX, W[BX] – MOVAX, [W+BX] – MOVAX, [BX+W] – MOVAX, W+[BX] – MOVAX, [BX]+W

Indexed – SI source index or DI dest index E.g., suppose SI contains the address of a word array W. Instruction – MOV AX, [SI+2];displ is 2 -The instruction moves the contents of W+2 to AX. -This is the 2 nd element of the array -Other forms:

Other forms MOV AX, [SI+2];displ is 2 MOV AX, 2+[SI] MOV AX, [SI]+2 MOV AX, [SI+2] MOV AX, 2[SI]

Q. Write some code to sum in AX the elements of an array. Idea: is to set a pointer to the base of the array, & let it move up the array, & summing elements as it goes. XORAX, AX ;AX holds sum LEASI, W;SI points to array W MOVCX, 10 ;CX has no. of elements ADDARRAY: ADDAX, [SI];sum=sum + element ADDSI, 2 ;move pointer to the next element LOOPADDARRAY ;loop until done

This is done by  Register indirect AM. Add 2 as it is WORD, not BYTE array LEA moves the source offset address – into the destination.

The same - using based AM Based AM – BX [base reg] or BP [base pointer] The idea is to cleat BX – then add 2 to it on each trip – through summation loop. XORAX, BX ;AX holds sum XORBX, BX;clear base reg BX MOVCX, 10;CX has no. of elements ADDARRAY: ADDAX, W[BX];sum=sum+element ADDBX, 2;index next element LOOPADDARRAY;loop until done

LEA – Load effective address Loads an offset memory address to a register LEAdestination, source The offset address of the source memory operand is placed in the destination, which is a general register.

LOOP CX is decremented by 1, – If the result is not zero, then control is transferred to the labeled instruction; – Else, control flows to the next instruction Flags affected – none

8086 Memory Addressing Modes The 8086 provides 17 different ways to access memory! 17!! But – variants of one another. 5 basics are – I.displacement-only, II.base, III.displacement + base, IV.base + indexed, and V.displacement + base + indexed.

I. Displacement Only Addressing Mode displacement-only (or direct) addressing mode consists of a 16 bit constant that specifies the address of the target location. mov al, ds:[8088h] loads the al register with a copy of the byte at memory location 8088h. Likewise, the instruction mov ds:[1234h],dl stores the value in the dl register to memory location 1234h:

Indexed addressing uses a register (implicitly or explicitly) as an offset, which is added to the address in the operand to determine the effective address of the data. Based addressing is similar except that a base register is used instead of an index register. The difference between these two is that an index register holds an offset relative to the address given in the instruction, a base register holds a base address where the address field represents a displacement from this base.

Pipelining Some CPUs divide the fetch-decode-execute cycle into smaller steps. These smaller steps can often be executed in parallel to increase throughput. Such parallel execution is called instruction- level pipelining. This term is sometimes abbreviated ILP in the literature.