Khaled A. Al-Utaibi  I/O Ports  I/O Space VS Memory Space  80x86 I/O Instructions − Direct I/O Instructions − Indirect I/O Instructions.

Slides:



Advertisements
Similar presentations
MICROPROCESSOR BASED SYSTEM DESIGN
Advertisements

Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
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.
Chapter 2 (cont.) An Introduction to the 80x86 Microprocessor Family Objectives: The different addressing modes and instruction types available The usefulness.
Parul Polytechnic Institute
There are two types of addressing schemes:
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Engineering 4862 Microprocessors Lecture 23 Cheng Li EN-4012
The 8085 Microprocessor Architecture
University of Tehran 1 Microprocessor System Design Interrupt Omid Fatemi
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
Vacuum tubes Transistor 1948 –Smaller, Cheaper, Less heat dissipation, Made from Silicon (Sand) –Invented at Bell Labs –Shockley, Brittain, Bardeen ICs.
P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
80x86 Processor Architecture
TK I/O Peripherals Interface DR MASRI AYOB.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
The 8086 Microprocessor The 8086, announced in 1978, was the first 16-bit microprocessor introduced by Intel Corporation 8086 is 16-bit MPU. Externally.
Khaled A. Al-Utaibi Memory Devices Khaled A. Al-Utaibi
Memory interface Memory is a device to store data
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
CPU Interfacing Memory.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
3.7 String Instructions Specifying the Operands’ Size and Address and the String Direction STRING = a data collection in memory. String ELEMENTS can be:
The 8253 Programmable Interval Timer
Fig 8-4 p-341. S 5 =IF flag (interrupt Enable). S 6 =0 always.
Computer Architecture Lecture 8 by Engineer A. Lecturer Aymen Hasan AlAwady 30/12/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
BASIC INPUT AND OUTPUT INTERFACING.  8085A communicate with outside world using the I/O devices.  Since memory and I/O devices share the system bus,
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
Computer Architecture Lecture 9 by Engineer A. Lecturer Aymen Hasan AlAwady 10/2/2014 University of Kufa - Information Technology Research and Development.
Eng.Samra Essalaimeh Philadelphia University 2013/ nd Semester PIC Microcontrollers.
Khaled A. Al-Utaibi  Memory Interface and the 3 Buses  Interfacing the 8088 Processor  Interfacing the 8086 Processor  Interfacing.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
I/O AND THE 8255; ISA BUS INTERFACING
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Basic I/O Interface Fixed Address Variable Address
Intel 8086 (8088) Microprocessor Structure
1 Microprocessors CSE – 341 Basic I/O Interfacing.
I/O Interface. INTRO TO I/O INTERFACE I/O instructions (IN, INS, OUT, and OUTS) are explained. Also isolated (direct or I/O mapped I/O) and memory-mapped.
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Khaled A. Al-Utaibi  Introduction  The MOV Instruction  The LEA Instruction  The Stack Instructions  The String Data Transfer.
Lecture 6 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
The 8085 Microprocessor Architecture
Interfacing I/O Devices
Introduction to 8086 Microprocessor
The 8085 Microprocessor Architecture
Computer Organization & Assembly Language Chapter 3
Interfacing 64Kb EPROM with 8085
ADDRESSING MODES.
Chapter 4 Data Movement Instructions
Basic Microprocessor Architecture
ADDRESSING MODES.
Intel 8088 (8086) Microprocessor Structure
Assembly Lang. – Intel 8086 Addressing modes – 1
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Interfacing Memory Interfacing.
I/O Interfacing CSE 2312 Maher Al-Khaiyat.
Chapter 4 Data Movement Instructions
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
Parallel communication interface 8255
Morgan Kaufmann Publishers Computer Organization and Assembly Language
The 8085 Microprocessor Architecture
Data Movement Instructions
Unit-I 80386DX Architecture
Presentation transcript:

Khaled A. Al-Utaibi

 I/O Ports  I/O Space VS Memory Space  80x86 I/O Instructions − Direct I/O Instructions − Indirect I/O Instructions − String I/O Instructions  Accessing I/O Ports in 80x86 Processors  Designing a Parallel Input Port  Designing a Parallel Output Port

 Processors use I/O devices to input, process, and then output information to perform useful work.  The I/O devices can be connected to a computer system through I/O ports.  An I/O port is similar to a memory location in that each port must have its own address.  With the 80x86 processors, the port address is 16 bits long, allowing addresses in the range 0000 through FFFFH.  The ports themselves may be 8, 16, or 32 bits wide. The resulting interface is therefore said to be using parallel I/O.

 The 80x86 processors use the M/IO signal to separate I/O space from memory space (as shown in the next figure).  When this signal is high, addresses output by the processor will be interpreted as memory locations.  However, when this line is low, those same addresses will be interpreted as I/O locations.  Because I/O addresses are restricted to 16 bits, valid I/O addresses range from 0000 to FFFFH.

 The 80x86 processors have just two basic I/O instruction IN and OUT.  However, there are several variations of each, depending on: − the size of the data to be input or output (byte, word, or double-word), − the method of specifying the port (direct or indirect), and − the method of specifying the source and destination of the data.  These are summarized in the next table.

 The direct I/O instructions supply the port address (which must be a number between 0 and FFH) as part of the instruction. For example: IN AL, 27H ; input the byte at port 27H ; to register AL  Note that all data must flow through the accumulator register (AL, AX, EAX).  Thus, to output the 16-bit quantity in register BX to port 27H, two instructions are required: MOV AX,BX ; move data to AX OUT 26H, AX ; output the AX to port 26H  In this last instruction, AL is output to port 26H and AH to port 27H.

 To access the full range of I/O ports from 0 to FFFFH, the indirect I/O instructions must be used.  For these instructions, register DX must be preloaded with the port address.  For example, to input the 32-bit quantity at port 1000H, use the instructions: MOV DX,1000H ; load port address into DX IN EAX,DX ; input the word whose port ; address is in DX to EAX  Because four bytes of data are being input, ports 1000, 1001, 1002, and 1003 will all be accessed for this last instruction.

 The direct and indirect I/O instructions require that all data pass through the accumulator.  The string I/O instructions allow data to pass directly to or from a memory location.  For example, assume 4K of data (in a segment named D_DATA with the first byte at an offset called TOP) is to be output to a disk drive at port 47H.

 The following instructions can be used. MOV AX,D_DATA ; get segment address MOV DS,AX ; and copy to DS LEA SI,TOP ; offset address of the data to SI CLD ; clear direction flag (auto-incr) MOV DX,47H ; DX points to the I/O port MOV CX,1000H ; CX is the byte counter (4K) REP OUTSB ; Output the contents of the data ; table to the I/O port  In this example, the REP OUTSB instruction outputs a byte from memory pointed to by DS:SI, increments SI to point to the next memory location, and decrements the byte counter in CX.  The instruction is repeated until CX equals zero.

 The 8086 processor has a 16-bit data bus.  It uses the A0 address line and the BHE (bus high enable) signal to identify which data lines will be involved in the data transfer.  When A0 only is low, data is transferred on D0- D7.  When BHE' only is low, data is transferred on D8- D15.  When A0 and BHE' are both low, data is transferred on all 16 data lines.  These cases are shown in the next table.

 When the 8086 executes the instruction IN AL,0, it places the 16-bit I/O address on bus lines A15 through A0 and makes BHE’ signal high  The instruction IN AL,1 outputs the 16-bit I/O address , and makes BHE' signal low.  The instruction IN AX, 0 outputs the 16-bit I/O address , and makes the BHE’ signal low.  This instruction results in a 16-bit word access (D0-D15).

 The 386 & 486 processors have 32-bit data bus and can access four bytes of memory (or four consecutive I/O Ports) in one bus cycle.  The A0 & A1 address lines, which would identify bytes within this four-byte boundary, are not present.  Instead four active-low byte enable signals (BE3'- BE0') are provided.  The next table show which set of data bus lines will be active for each byte enable.

 When the 386 or 486 executes the instruction IN AL,0, it places the 14-bit I/O address on bus lines A15 through A2.  It also activates the BE0' byte enable.  Similarly, the instruction IN AL,1 outputs the same 14-bit I/O address, but this time BE1' is made active.  A 16-bit word access causes two byte enables to be active simultaneously.  For example, when the instruction IN AX,0 is executed, the same 14-bit I/O address is output, but this time BE0' and BE1' are made active.  BE2' and BE3' would be active for the instruction IN AX,2.  All four ports can be accessed at once with the instruction IN EAX,0. In this case, all of the byte enables are made active.

 The Pentium processors are similar to the 386 and 486 processors but access eight bytes at a time.  For these processors, the A0-A2 address lines are not needed.  Eight byte enable signals are provided (BE7'- BE0').

 Example 1: Design a simple 8-bit input interface using 8- switches and 8 tri-state buffers.

 Example 2: Show how to design a 16-bit input port for the 8086 processor using the 8-switches input interface designed in Example 1. Assume your design will be mapped to port number 6. Step (1): Design the address decoding A 15 -A 12 A 11 -A 8 A 7 -A 4 A 3 A 2 A 1 A (Even Byte) (Odd Byte) Address Decoding Chip Select (CS’) Step (2): Design the Read Logic RD’ = IOR’

 Example 3: Design a simple 8-bit Output interface using 8- LEDs and 8 latches (74373).

 Example 4: Show how to design a 16-bit output port for the 8086 processor using the 8-LEDs output interface designed in Example 3. Assume your design will be mapped to port number 4. Step (1): Design the address decoding A 15 -A 12 A 11 -A 8 A 7 -A 4 A 3 A 2 A 1 A (Even Byte) (Odd Byte) Address Decoding Chip Select (CS’) Step (2): Design the Read Logic WR’ = IOW’