ENGR 4862 Microprocessors Lecture 7 - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

ENGR 4862 Microprocessors Lecture 7

Description:

A single memory element located inside the CPU (microprocessor chip) In 8086/8088, each register has 16 bits ... Little/Big Endian: from Gulliver's Travel Story ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 12
Provided by: lihong2
Category:

less

Transcript and Presenter's Notes

Title: ENGR 4862 Microprocessors Lecture 7


1
ENGR 4862 MicroprocessorsLecture 7
2
Register Review
  • What is a register
  • A single memory element located inside the CPU
    (microprocessor chip)
  • In 8086/8088, each register has 16 bits of info
  • From a programming point of view, a register is a
    permanently declared variable
  • Assembly code C code
  • INC AX ax

3
8086/8088 Programming Model
General Purpose Registers
Segment Registers
Code Segment
Accumulator
AX
AH
AL
CS
Data Segment
Base
BX
BH
BL
DS
Extra Segment
Count
CX
CH
CL
ES
Stack Segment
Data
DX
DH
DL
SS
Pointer Registers
Flag Register
Status and Control Flags
Stack Pointer
SP
FlagsH
FlagsL
Base Pointer
BP
Instruction Register
Index Registers
Instruction Pointer
Source Index
SI
IP
Destination Index
DI
Except in Data group, all registers are 16 bits
(2 bytes) long.
4
Intel 80x86 Family Microprocessors
  • Overview of Intel 80x86 Family
  • Numbering, Coding and Converting
  • 8086/8088 Architecture
  • Segment Programming and Assembly Language
  • Offset Address, Logical Address and Physical
    Address
  • Addressing Mode

5
Addresses
  • Three types of addresses frequently used
  • Physical address
  • The 20-bit address that is actually put on the
    address pins of the uP and decoded by the memory
    interfacing circuitry
  • Range from 00000H to FFFFFH for 8086/88 and 286,
    386, 486 for real mode
  • Actual physical location in RAM or ROM within the
    1MB memory range
  • Offset address
  • A location within a 64K-byte segment range,
    0000HFFFFH
  • Logical address
  • Consist of a segment value and an offset address

6
Program Segments
  • A segment is an area of memory that includes up
    to 64KB and begins on an address evenly dividable
    by 16 (i.e., an address ends in 0H)
  • Why 64K for segment?
  • Its from 8085 uP (16 address pins) to ensure
    compatibility. 8085 has 64KB for all code, data,
    and stack. In 8086, therere up to 64KB to each
    segment.
  • A typical assembly language program consists of
    at least three segments a code segment (CS), a
    data segment (DS), and stack segment (SS). Extra
    segment (ES) is not required for every program

7
Code Segment
  • To execute a program, the 8086/88 fetch
    instruction (including opcodes and operands) from
    the code segment
  • The logical address of an instruction always
    consists of a CS and IP (CSIP)
  • The physical address of the instruction is
    generated by shifting the CS left one hex digit
    (4-bit) and then adding it to the IP. The
    resulting 20-bit address is the physical address
    and it is put on the external address bus to be
    decoded by memory circuitry

8
Example
  • CS 2200H, IP 957BH
  • Offset address 957BH
  • Logical address 2200H957BH
  • Physical address 2B57BH
  • It can have many different logical addresses for
    one single physical address

9
Data Segment
  • Store data information that needs to be processed
    by the instructions in the code segment
  • Data segment uses register DS and an offset value
  • E.g., ADD AL, 200H AL ? AL DS0200H
  • The offset address is enclosed in brackets, which
    indicates that the operand represents the address
    of the data and not the data itself
  • Without the , it will be an immediate number
  • The 8086/88 allows only the use of registers BX,
    SI, and DI as offset registers for the data
    segment

10
Data and Extra Segment
  • The physical address of data is calculated using
    the same rules as for the code segment
  • Extra Segment (ES)
  • Many normal programs do not use
  • Essential in String operations

11
Little Endian, Big Endian
  • When deal with 16-bit data fetch or store
  • E.g., MOV AX, 35F3H
  • MOV 1500H, AX
  • Result DS1500H ??, DS1501H ??
  • Little/Big Endian from Gullivers Travel Story
  • Little Endian Convention low byte goes to the
    low memory location and the high byte goes to the
    high memory address
  • All Intel uP, DEC VAX use little endian
    convention, while Motorola, Macintosh uP, and
    some mainframes use big endian convention
Write a Comment
User Comments (0)
About PowerShow.com