Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 1 Chapter four 80x86.

Slides:



Advertisements
Similar presentations
Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Advertisements

Registers of the 8086/ /2002 JNM.
There are two types of addressing schemes:
Microprocessor Fundamentals Week 5 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
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.
Department of Computer Science and Software Engineering
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.
Handout 2 Digital System Engineering (EE-390)
Stack Memory H H FFFFF H FFFFE H SS 0105 SP 0008 TOS BOS BOS = FFFF = 1104F H H 1104F H.
BUS Timing BREY-P.322. Bus Timing There are three types of buses of 8086 and 8088  address, data and control– function exactly the same way as those.
Addressing modes – 1 The way in which an operand is specified is called the Address Mode.
The 8086 Assembly Programming Data Allocation & Addressing Modes
Addressing Modes Instruction – Op-code – Operand Addressing mode indicates a way of locating data or operands. – Any instruction may belong to one or more.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
Microprocessor Systems Design I
80x86 Processor Architecture
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2013 Lecture 4: 80386DX memory, addressing.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2014 Lecture 4: x86 memory.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
Types of Registers (8086 Microprocessor Based)
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
Microprocessor Microprocessor (cont..) It is a 16 bit μp has a 20 bit address bus can access upto 220 memory locations ( 1 MB). It can support.
University of Tehran 1 Microprocessor System Design Omid Fatemi Machine Language Programming
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.
Internal Programming Architecture or Model
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
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
Microprocessor Systems Design I
Introduction to 8086 Microprocessor
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
16.317: Microprocessor System Design I
Instruksi Set Prosesor 8088
ADDRESSING MODES.
Microprocessor Systems Design I
EEM336 Microprocessors Laboratory Orientation
Assembly IA-32.
ADDRESSING MODES.
Intel 8088 (8086) Microprocessor Structure
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
Introduction to Assembly Language
Data Addressing Modes • MOV AX,BX; This instruction transfers the word contents of the source-register(BX) into the destination register(AX). • The source.
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
CS-401 Computer Architecture & Assembly Language Programming
اصول اساسی برنامه نویسی به زبان اسمبلی
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.
Computer Architecture CST 250
Unit-I 80386DX Architecture
Chapter 6 –Symbolic Instruction and Addressing
(Array and Addressing Modes)
Presentation transcript:

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 1 Chapter four 80x86 Instruction Set ( 2 ) 8086 Addressing Modes

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2 What is the Addressing Mode ? add dest, source ; dest +source→dest add ax,bx ; ax +bx→ax The addressing mode means where and how the CPU gets the operands when the instruction is executed.

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 3 Three types of 8086 addressing modes Immediate Addressing Mode ---CPU gets the operand from the instruction Register Addressing Mode ---CPU gets the operand from one of the internal registers Memory Addressing Mode ---CPU gets the operand from the memory location(s)

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 4 Exp : MOV AL, 80H Machine code:B080H AL B0H 80H Instruction Queue MACHINE CODE B8 12H Instruction Queue AL MACHINE CODE AH 34H H Immediate Addressing Mode MOV AX, 1234H Machine code:B83412H

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 5 Exp : MOV AX, CX 89 C1 Memory AX CX Machine code 2. Register Addressing Mode

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 6 Specify an offset address (effective address) using expressions of the form (different parts of expression are optional): –[ Base Register + Index Register+ Displacement] 1) Base Register---BX, BP 2) Index Register---SI, DI 3) Displacement ---constant value Example: 1) add ax,[20h] 2) add ax,[bx] 3) add ax,[bx+20h] 4) add ax, [bx+si] 5) add ax, [bx+si+20h] 3. Memory Addressing Mode

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 7 ⑴ Direct Addressing Mode Exp: MOV AL, [1064H] Machine code:A06410H The offset address of the operand is provided in the instruction directly; The physical address can be calculated using the content of DS and the offset : PA = (DS)*10H+Offset 3. Memory Addressing Mode

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 8 ⑴ Direct Addressing Mode Example: MOV AL, [1064h] ;Assume (DS)=2000H Machine code: A06410H 21064H ( DS)*10H=20000H 20000H 21064H AL A … Code Segment Data Segment H

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 9 ⑵ Register Indirect Addressing Mode The address of memory location is in a register (SI,DI,or BX only) The physical address is calculated using the content of DS and the register(SI,DI,BX) PA = (DS)*10H+(SI)/(DI)/(BX) 3. Memory Addressing Mode

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 … … M AX ⑵ Register Indirect Addressing Mode ASSUME: (DS)=3000H, (SI)=2000H, (BX)=1000H 30000H (DS)*10H=30000H (SI)= 2000H H … … 64H M AL 30000H (DS)*10h= 30000H (BX)= 1000H H 64H MOV [BX], AL MOV AX, [SI]

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 11 ⑶ Register Relative Addressing EA= (BX) (BP) (DI) (SI) + Displacement For physical address calculation: DS is used for BX,DI,SI; SS is used for BP PA=(DS)*10H+(BX)/(DI)/(SI)+Disp OR PA=(SS)*10H+(BP)+Disp

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 12 ⑶ Register Relative Addressing MOV CL, [BX+1064H] ;assume: (DS)=2000h, (bx)=1000h ;Machine Code: 8A8F H 8F … Code Segment Data Segment 8A … CL H (BX)= 1000H (DS)*10h= 20000H 20000H H PA=(ds)*10h+(bx)+10 64h

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 13 ⑷ Based Indexed Addressing EA= (BX) (BP) + (DI) (SI) Base register(bx or bp) determines which segment(data or stack) the operand is stored; if using BX, the operand is defaultly located in Data segment,then: PA=(DS)*10H+(BX)+(DI)/(SI) if using BP, the operand is defaultly located in stack segment,then: PA=(SS)*10H+(BP)+(DI)/(SI)

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 14 ⑷ Based Indexed Addressing Example: MOV AH, [BP][SI]; Assume(ss)=4000h,(bp)=2000h,(si)=1200h 56H … … M AH 40000H (SS)*10H= 40000H (BP)= 2000H H (SI)= 1200H 56H PA=(ss)*10h+(bp)+(si)

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 15 ⑸ Based Indexed Relative Addressing EA= (BX) (BP) + (DI) (SI) + Displacement if using BX, the operand is defaultly located in Data segment,then: PA=(DS)*10H+(BX)+(DI)/(SI)+disp if using BP, the operand is defaultly located in stack segment,then: PA=(SS)*10H+(BP)+(DI)/(SI)+disp

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 16 ⑸ Based Indexed Relative Addressing MOV [BX+DI+1234H], AH ;assume (ds)=4000h,(bx)=0200h,(di)=0010h ;machine code:88A13412h A … Code segment Data segment 88 … 45 AH 40000H (DS)*10H=40000H (BX)= 0200H + (DI)= 0010H 1234H H

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 17 Summary on the 8086 memory addressing modes operand offset address Default Overridden ( effective address ) Segment Register Segment Register 3. Register [SI/DI/BX/BP+disp] (SI)/(DI)/(BX)/(BP)+disp DS CS ES SS Relative Addressing 2. Register [BX]/[SI] /[DI] Content of the R DS CS ES SS Indirect Addressing 1. Direct Addressing [disp] disp DS CS ES SS 4. Based Indexed [BX+SI/DI] (BX)+disp DS CS ES SS Addressing [BP+SI/DI] (BP)+disp SS CS ES DS 5. Based Indexed [BX+SI/DI+disp] (BX)+(SI)/(DI)+disp DS CS ES SS Relative Addressing [BP+SI/DI+disp] (BP)+(SI)/(DI)+disp SS CS ES DS

Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 18 Examples: Assume: (BX)=6000H, (BP)=4000H, (SI)=2000H, (DS)=3000H, (ES)=3500H, (SS)=5000H 3000 : H Direct Addressing 2. MOV AX, [BX] 1. MOV AX, [0520H] 5. MOV AX, ES: [BX+SI+0050H] 4. MOV AX, [BP+6060H] Register Indirect Addressing 3000 : H Register Relative Addressing 3. MOV AX, [SI+1000H] 3000 : H 5000 : A060 5A060H 3500 : D050H Based Indexed Relative Addressing Instruction addressing logical physical mode address address mode address address