DAT2343 80x86 “Real” Memory Addressing © Alan T. Pinck / Algonquin College; 2003.

Slides:



Advertisements
Similar presentations
Programming 8086 – Part IV Stacks, Macros
Advertisements

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.
Registers of the 8086/ /2002 JNM.
There are two types of addressing schemes:
Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Intel MP.
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.
Lecture 2 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
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 Instructor: Dr. Michael Geiger Fall 2012 Lecture 15: Protected mode intro.
Microprocessor Systems Design I
80x86 Processor Architecture
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2013 Lecture 4: 80386DX memory, addressing.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
An Introduction to 8086 Microprocessor.
The Intel Microprocessors. Real Mode Memory Addressing Real mode, also called real address mode, is an operating mode of and later x86-compatible.
Types of Registers (8086 Microprocessor Based)
The x86 Architecture Lecture 15 Fri, Mar 4, 2005.
SYSC30061 The Intel 80x86 Thorne : Section , 2.2.4, Section 3.4 (Irvine, Edition IV : Section 2.2)
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
INTRODUCTION TO MICROPROCESSOR Engr. Ammar Anwar Khan.
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.
8086 Internal Architecture
Intel 8086 (8088) Microprocessor Structure
University of Tehran 1 Microprocessor System Design Omid Fatemi Machine Language Programming
X86 Assembly Language We will be using the nasm assembler (other assemblers: MASM, as, gas)
University of Sargodha, Lahore Campus Prepared by Ali Saeed.
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
Internal Programming Architecture or Model
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Lecture on Real Mode Memory Addressing
Instruction set Architecture
Presentation on Real Mode Memory Addressing
Data Transfers, Addressing, and Arithmetic
Microprocessor Systems Design I
Microprocessor Systems Design I
Introduction to 8086 Microprocessor
ADDRESSING MODES.
Microprocessor Systems Design I
ADDRESSING MODES.
University of Gujrat Department of Computer Science
Chapter 3 Addressing Modes
Morgan Kaufmann Publishers Computer Organization 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.
Stack and Subroutines Module M17.1 Section 11.2.
Programming 8086 – Part IV Stacks, Macros
8086 Registers Module M14.2 Sections 9.2, 10.1.
8086 Ahad.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
(Array and Addressing Modes)
CS 301 Fall 2002 Computer Organization
Symbolic Instruction and Addressing
CNET 315 Microprocessor & Assembly Language
Lecture 06 Programming language.
Unit-I 80386DX Architecture
Chapter 6 –Symbolic Instruction and Addressing
Intel 8086.
Memory segmentation and addressing
Computer Architecture and System Programming Laboratory
(The Stack and Procedures)
Presentation transcript:

DAT x86 “Real” Memory Addressing © Alan T. Pinck / Algonquin College; 2003

“Real” Memory Space In Intel/Microsoft terminology, “real” memory is the first 1 Megabyte of memory (memory beyond this is “protected” or “extended” memory and will not be discussed in this course). “Real” memory requires a 20-bit address (5 hex digits)

Addresses and Words A Intel 8086 word : 16 bits (2 bytes) Addresses are specified using word values (often contained in 16-bit/word registers) Problem: how to create a 20-bit address when only 16-bit (word) values are available.

Offset Addresses: Accessibility with a Word Address Assuming some (20-bit) base location, a 16- bit (word) address could be used to measure a distance or “offset” from that base location to any location between 0 and 64K bytes beyond that base location. Example (assuming a base location of 2A340 hex) a 16-bit offset value 47E2 (hex) would provide the address for a “real” memory location 2EB22 (hex).

Segment Addresses A “segment” is the maximum amount of “real” memory which can be addressed using a 16-bit offset from some “base location”. The “base location” for a segment is specified as a 16-bit value, called a “segment address”, which is the number of pages (1 page = 10 hex / 16 dec bytes) from the beginning of memory.

Combining Segment and Offset Addresses A segment address can be converted from a 16-bit page number into a 20-bit “real” memory (byte) value by multiplying it by 10 hex (since there are 10 hex bytes per page). Segment and Offset combinations are usually written as: segment:offset As an example 2A34:47E2, which can be converted into a “real” (byte) address as 2A34 * 10 h = 2A340 plus 47E2 = 2EB22

The Segment Registers In the Intel 8086 : 4 Registers used for Segment Addresses CSbeginning of the current code (instruction) segment area DSbeginning of the main (default) data segment area ESbeginning of a secondary data segment area SSbeginning of an area use for the “stack” (mainly used to hold function return addresses and temporary local variables)

The Offset Registers In the Intel 8086: 6 Registers use for Offsets IPinstruction pointer: (with CS) offset to next instruction to be executed BXbase index: (default, with DS) offset to a data value SIsource index: (default, with DS) offset to a data value (often the “source” of a “source-destination” pair DIdestination index: (default, with ES or DS depending on instruction) offset to a data value SPstack pointer: (with SS) offset to last value stored on the stack BPbase pointer: (default, with SS) offset to data value in the stack to permit access/manipulation of value in the stack without “losing” track of the top of the stack.

Real Memory Address Calculation Examples (1) MOV [BX],0Dh ;location of memory ; specified by the value in BX By default, BX combines with DS Suppose DS = 1380 and BX=0100 (all values in hex) Then the real memory address into which the value 0Dh is to be moved would be: = (hex)

Real Memory Address Calculation Examples (2) MOV [ES:BX],0Dh ;location of memory ; specified by the values in ES and BX The default has been overridden so ES is used for the segment portion of the address Suppose ES = 26BE and BX=0100 (all values in hex) Then the real memory address into which the value 0Dh is to be moved would be: 26BE = 26CE0 (hex)

Real Memory Address Calculation Examples (3) MOV [0200h],0Dh ;location of memory ; specified immediate offset value 0200h Since no segment override has been coded (and this is an instruction which involves data), the DS register will be used for the segment address. Suppose DS contains 278C (all values in hex) Then the real memory address into which the value 0Dh is to be moved would be: 278C = 27AC0 (hex)

Real Memory Address Calculation Examples (4) JMP 2AC4 ;location of memory containing ; next instruction specified as an ; immediate value The default has not been overridden and since this instruction deals with the address of another instruction (not data), the CS register will be used for the segment address. Suppose CS = 1E02 (all values in hex) Then the real memory address of the instruction being “jumped” to would be: 1E AC4 = 20AE4 (hex)

Real Memory Address Calculation Examples (5) JMP 4001:2AC4 ;location of memory containing ; next instruction specified as a pair ; of immediate value The default has been overridden with an immediate value which will be used for the segment address. Then the real memory address of the instruction being “jumped” to would be: AC4 = 42AD4 (hex)

Real Memory Address Calculation Examples (6) PUSH AX ; stores (2-byte) value in AX ; on stack The PUSH instruction automatically uses the SS:SP pair; however, the value in the SP points to the last value stored on the stack, so it must be decremented by 2 before these 2 bytes can be stored. Suppose SS = 12D3 and SP=04E6 (all values in hex) Then the real memory address when the value in AX would be stored would be 12D30 + (04E6 – 2) = (hex)

End of Lecture