8086 min max mode operations modified

78
THE 8088 AND 8086 MICROPROCESSORS AND THEIR MEMORY AND INPUT/OUTPUT INTERFACES 1

Upload: ritu-rathi

Post on 27-Oct-2014

178 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 8086 Min Max Mode Operations Modified

THE 8088 AND 8086MICROPROCESSORS ANDTHEIR MEMORY ANDINPUTOUTPUT INTERFACES

1

THE 8088 AND 8086 MICROPROCESSORS ANDTHEIR MEMORY AND INPUTOUTPUT INTERFACES

81 The 8088 and 8086 Microprocessors 82 Minimum-Mode and Maximum-Mode

System 83 Minimum-Mode Interface 84 Maximum-Mode Interface 85 Electrical Characteristics 86 System Clock 87 Bus Cycle and Time States 88 Hardware Organization of the Memory

Address Space

2

THE 8088 AND 8086 MICROPROCESSORS ANDTHEIR MEMORY AND INPUTOUTPUT INTERFACES

89 Memory Bus Status Codes 810 Memory Control Signals 811 Read and Write Bus Cycles 812 Memory Interface Circuits 813 Programmable Logic Arrays 814 Types of InputOutput 815 An Isolated InputOutput Interface 816 InputOutput Data Transfer 817 InputOutput Instructions 818 InputOutput Bus Cycles

3

The 8088 and 8086 Microprocessors

The 8086 announced in 1978 was the first 16-bit microprocessor introduced by Intel Corporation

8086 and 8088 are internally 16-bit MPU Externally the 8086 has a 16-bit data bus and the

8088 has an 8-bit data bus

4

The 8088 and 8086 Microprocessors (cont)

8086 and 8088 both have the ability to address up to 1 Mbyte of memory and 64K of inputoutput port

The 8088 and 8086 are both manufactured using high-performance metal-oxide semiconductor (HMOS) technology

The 8088 and 8086 are housed in a 40-pin dual inline package and many pins have multiple functions

5

The 8088 and 8086 Microprocessors (cont)

CMOS Complementary Metal-Oxide-Semiconductor is a major class of integrated circuits used in chips such as microprocessors microcontrollers static RAM digital logic circuits and analog circuits such as image sensors

Two important characteristics of CMOS devices are high noise immunity and low static power supply drain

Significant power is only drawn when its transistors are switching between on and off states

6

The 8088 and 8086 Microprocessors (cont)

CMOS devices do not produce as much heat as other forms of logic such as TTL

CMOS also allows a high density of logic functions on a chip

7

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 2: 8086 Min Max Mode Operations Modified

THE 8088 AND 8086 MICROPROCESSORS ANDTHEIR MEMORY AND INPUTOUTPUT INTERFACES

81 The 8088 and 8086 Microprocessors 82 Minimum-Mode and Maximum-Mode

System 83 Minimum-Mode Interface 84 Maximum-Mode Interface 85 Electrical Characteristics 86 System Clock 87 Bus Cycle and Time States 88 Hardware Organization of the Memory

Address Space

2

THE 8088 AND 8086 MICROPROCESSORS ANDTHEIR MEMORY AND INPUTOUTPUT INTERFACES

89 Memory Bus Status Codes 810 Memory Control Signals 811 Read and Write Bus Cycles 812 Memory Interface Circuits 813 Programmable Logic Arrays 814 Types of InputOutput 815 An Isolated InputOutput Interface 816 InputOutput Data Transfer 817 InputOutput Instructions 818 InputOutput Bus Cycles

3

The 8088 and 8086 Microprocessors

The 8086 announced in 1978 was the first 16-bit microprocessor introduced by Intel Corporation

8086 and 8088 are internally 16-bit MPU Externally the 8086 has a 16-bit data bus and the

8088 has an 8-bit data bus

4

The 8088 and 8086 Microprocessors (cont)

8086 and 8088 both have the ability to address up to 1 Mbyte of memory and 64K of inputoutput port

The 8088 and 8086 are both manufactured using high-performance metal-oxide semiconductor (HMOS) technology

The 8088 and 8086 are housed in a 40-pin dual inline package and many pins have multiple functions

5

The 8088 and 8086 Microprocessors (cont)

CMOS Complementary Metal-Oxide-Semiconductor is a major class of integrated circuits used in chips such as microprocessors microcontrollers static RAM digital logic circuits and analog circuits such as image sensors

Two important characteristics of CMOS devices are high noise immunity and low static power supply drain

Significant power is only drawn when its transistors are switching between on and off states

6

The 8088 and 8086 Microprocessors (cont)

CMOS devices do not produce as much heat as other forms of logic such as TTL

CMOS also allows a high density of logic functions on a chip

7

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 3: 8086 Min Max Mode Operations Modified

THE 8088 AND 8086 MICROPROCESSORS ANDTHEIR MEMORY AND INPUTOUTPUT INTERFACES

89 Memory Bus Status Codes 810 Memory Control Signals 811 Read and Write Bus Cycles 812 Memory Interface Circuits 813 Programmable Logic Arrays 814 Types of InputOutput 815 An Isolated InputOutput Interface 816 InputOutput Data Transfer 817 InputOutput Instructions 818 InputOutput Bus Cycles

3

The 8088 and 8086 Microprocessors

The 8086 announced in 1978 was the first 16-bit microprocessor introduced by Intel Corporation

8086 and 8088 are internally 16-bit MPU Externally the 8086 has a 16-bit data bus and the

8088 has an 8-bit data bus

4

The 8088 and 8086 Microprocessors (cont)

8086 and 8088 both have the ability to address up to 1 Mbyte of memory and 64K of inputoutput port

The 8088 and 8086 are both manufactured using high-performance metal-oxide semiconductor (HMOS) technology

The 8088 and 8086 are housed in a 40-pin dual inline package and many pins have multiple functions

5

The 8088 and 8086 Microprocessors (cont)

CMOS Complementary Metal-Oxide-Semiconductor is a major class of integrated circuits used in chips such as microprocessors microcontrollers static RAM digital logic circuits and analog circuits such as image sensors

Two important characteristics of CMOS devices are high noise immunity and low static power supply drain

Significant power is only drawn when its transistors are switching between on and off states

6

The 8088 and 8086 Microprocessors (cont)

CMOS devices do not produce as much heat as other forms of logic such as TTL

CMOS also allows a high density of logic functions on a chip

7

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 4: 8086 Min Max Mode Operations Modified

The 8088 and 8086 Microprocessors

The 8086 announced in 1978 was the first 16-bit microprocessor introduced by Intel Corporation

8086 and 8088 are internally 16-bit MPU Externally the 8086 has a 16-bit data bus and the

8088 has an 8-bit data bus

4

The 8088 and 8086 Microprocessors (cont)

8086 and 8088 both have the ability to address up to 1 Mbyte of memory and 64K of inputoutput port

The 8088 and 8086 are both manufactured using high-performance metal-oxide semiconductor (HMOS) technology

The 8088 and 8086 are housed in a 40-pin dual inline package and many pins have multiple functions

5

The 8088 and 8086 Microprocessors (cont)

CMOS Complementary Metal-Oxide-Semiconductor is a major class of integrated circuits used in chips such as microprocessors microcontrollers static RAM digital logic circuits and analog circuits such as image sensors

Two important characteristics of CMOS devices are high noise immunity and low static power supply drain

Significant power is only drawn when its transistors are switching between on and off states

6

The 8088 and 8086 Microprocessors (cont)

CMOS devices do not produce as much heat as other forms of logic such as TTL

CMOS also allows a high density of logic functions on a chip

7

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 5: 8086 Min Max Mode Operations Modified

The 8088 and 8086 Microprocessors (cont)

8086 and 8088 both have the ability to address up to 1 Mbyte of memory and 64K of inputoutput port

The 8088 and 8086 are both manufactured using high-performance metal-oxide semiconductor (HMOS) technology

The 8088 and 8086 are housed in a 40-pin dual inline package and many pins have multiple functions

5

The 8088 and 8086 Microprocessors (cont)

CMOS Complementary Metal-Oxide-Semiconductor is a major class of integrated circuits used in chips such as microprocessors microcontrollers static RAM digital logic circuits and analog circuits such as image sensors

Two important characteristics of CMOS devices are high noise immunity and low static power supply drain

Significant power is only drawn when its transistors are switching between on and off states

6

The 8088 and 8086 Microprocessors (cont)

CMOS devices do not produce as much heat as other forms of logic such as TTL

CMOS also allows a high density of logic functions on a chip

7

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 6: 8086 Min Max Mode Operations Modified

The 8088 and 8086 Microprocessors (cont)

CMOS Complementary Metal-Oxide-Semiconductor is a major class of integrated circuits used in chips such as microprocessors microcontrollers static RAM digital logic circuits and analog circuits such as image sensors

Two important characteristics of CMOS devices are high noise immunity and low static power supply drain

Significant power is only drawn when its transistors are switching between on and off states

6

The 8088 and 8086 Microprocessors (cont)

CMOS devices do not produce as much heat as other forms of logic such as TTL

CMOS also allows a high density of logic functions on a chip

7

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 7: 8086 Min Max Mode Operations Modified

The 8088 and 8086 Microprocessors (cont)

CMOS devices do not produce as much heat as other forms of logic such as TTL

CMOS also allows a high density of logic functions on a chip

7

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 8: 8086 Min Max Mode Operations Modified

The 8088 and 8086 Microprocessors (cont)

Pin layout of the 8086 and 8088 microprocessor 8

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 9: 8086 Min Max Mode Operations Modified

Minimum-Mode and Maximum-Mode System

9

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 10: 8086 Min Max Mode Operations Modified

Minimum-Mode and Maximum-Mode System (cont)

Signals common to both minimum and maximum mode 10

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 11: 8086 Min Max Mode Operations Modified

Minimum-Mode and Maximum-Mode System (cont)

Unique minimum-mode signals11

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 12: 8086 Min Max Mode Operations Modified

Minimum-Mode and Maximum-Mode System (cont)

Unique maximum-mode signals

12

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 13: 8086 Min Max Mode Operations Modified

Minimum-Mode and Maximum-Mode System (cont)

13

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 14: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface

Block diagram of the minimum-mode 8088 MPU 14

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 15: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface (cont)

Block diagram of the minimum-mode 8086 MPU15

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 16: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface (cont)

The minimum-mode signals can be divided into the following basic groups AddressData bus Status signals Control signals Interrupt signals DMA interface signals

16

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 17: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface (cont)

AddressData bus The address bus is used to carry address information to

the memory and IO ports The address bus is 20-bit long and consists of signal lines

A0 through A19

A 20-bit address gives the 8088 a 1 Mbyte memory address space

Only address line A0 through A15 are used when addressing IO

This give an IO address space of 64 Kbytes The 8088 has 8 multiplexed addressdata bus lines

(A0~A7)

8086 has 16 multiplexed addressdata bus lines (A0~A15)

17

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 18: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface (cont)

Status signals The four most significant address A19 through A16

are multiplexed with status signal S6 through S3

Bits S4 and S3 together form a 2-bit binary code that identifies which of the internal segment registers was used to generate the physical address

S5 is the logic level of the internal interrupt flag S6 is always at the 0 logic level

18

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 19: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface (cont)

19

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 20: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface (cont)

20

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 21: 8086 Min Max Mode Operations Modified

Minimum-Mode Interface (cont)

21

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 22: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface

The maximum-mode configuration is mainly used for implementing a multiprocessorcoprocessor system environment Multiple processors exist in the system Each executes its own program

Global resources and local resources The former are common to all processors The latter are assigned to specific processors

In the maximum-mode facilities are provided for implementing allocation of global resources and passing bus control to other microprocessors sharing the system bus

22

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 23: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

8088 maximum-mode block diagram 23

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 24: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

8086 maximum-mode block diagram 24

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 25: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

8288 bus controller

Block diagram and pin layout of 828825

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 26: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

8288 bus controller In the maximum-mode 80888086 outputs a

status code on three signal line S0 S1 S2 prior to the initialization of each bus cycle

The 3-bit bus status code identifies which type of bus cycle is to follow and are input to the external bus controller device 8288

The 8288 produces one or two command signals for each bus cycle

26

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 27: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

8288 bus controller

Bus status code

27

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 28: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

28

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 29: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

29

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 30: 8086 Min Max Mode Operations Modified

Maximum-Mode Interface (cont)

Queue status signals The 2-bit queue status code QS0 and QS1 tells

the external circuitry what type of information was removed form the queue during the previous clock cycle

Queue status code30

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 31: 8086 Min Max Mode Operations Modified

Bus Cycle and Time States

A bus cycle defines the basic operation that a microprocessor performs to communicate with external devices

Examples of bus cycles are the memory read memory write inputoutput read and inputoutput write

The bus cycle of the 8088 and 8086 microprocessors consists of at least four clock periods

If no bus cycles are required the microprocessor performs what are known as idle states

When READY is held at the 0 level wait states are inserted between states T3 and T4 of the bus cycle

31

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 32: 8086 Min Max Mode Operations Modified

Bus Cycle and Time States (cont)

Bus cycle clock periods idle state and wait state32

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 33: 8086 Min Max Mode Operations Modified

Bus Cycle and Time States (cont)

EXAMPLE What is the duration of the bus cycle in the 8088-

based microcomputer if the clock is 8 MHz and the two wait states are inserted

Solution The duration of the bus cycle in an 8 MHz system

is given by tcyc = 500 ns + N x 125 ns

In this expression the N stands for the number of waits states For a bus cycle with two wait states we get

tcyc = 500 ns + 2 x 125 ns = 500 ns + 250 ns = 750 ns

33

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 34: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space

1Mx8 memory bank of the 8088 34

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 35: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

High and low memory banks of the 808635

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 36: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

Byte transfer by the 808836

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 37: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

Word transfer by the 808837

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 38: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

Even address byte transfer by the 808638

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 39: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

Odd address byte transfer by the 808639

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 40: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

Even address word transfer by the 8086

40

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 41: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

Odd-address word transfer by the 808641

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 42: 8086 Min Max Mode Operations Modified

Hardware Organization of the Memory Address Space (cont)

EXAMPLE Is the word at memory address 0123116 of an

8086-based microcomputer aligned or misaligned How many cycle are required to read it from memory

Solution The first byte of the word is the second byte at

the aligned-word address 0123016 Therefore the word is misaligned and required two bus cycles to be read from memory

42

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 43: 8086 Min Max Mode Operations Modified

Address Bus Status Codes

Whenever a memory bus cycle is in progress an address bus status code S4S3 is output by the processor S4S3 identifies which one of the four segment

register is used to generate the physical address in the current bus cycle 1048729

S4S3=00 identifies the extra segment register (ES)

S4S3=01 identifies the stack segment register (SS)

S4S3=10 identifies the code segment register (CS)

S4S3=11 identifies the data segment register (DS)

The memory address reach of the microprocessor can thus be expanded to 4 Mbytes 43

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 44: 8086 Min Max Mode Operations Modified

Memory Control Signals

Minimum-mode memory control signals

44

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 45: 8086 Min Max Mode Operations Modified

Memory Control Signals (cont)

Minimum-mode memory control signals (8088) ALE ndash Address Latch Enable ndash used to latch

the address in external memory IOM ndash Input-OutputMemory ndash signal external

circuitry whether a memory of IO bus cycle is in progress

DTR ndash Data TransmitReceive ndash signal external circuitry whether the 8088 is transmitting or receiving data over the bus 1048729

RD ndash Read ndash identifies that a read bus cycle is in progress

WR ndash Write ndash identifies that a write bus cycle is in progress

DEN ndash Data Enable ndash used to enable the data bus 1048729

SSO ndash Status Line ndash identifies whether a code or data access is in progress

45

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 46: 8086 Min Max Mode Operations Modified

Memory Control Signals (cont)

The control signals for the 8086rsquos minimum-mode memory interface differs in three ways IOM signal is replaced by MIO signal The signal SSO is removed from the interface BHE (bank high enable) is added to the interface

and is used to select input for the high bank of memory in the 8086rsquos memory subsystem

46

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 47: 8086 Min Max Mode Operations Modified

Memory Control Signals (cont)

Maximum-mode memory control signals

47

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 48: 8086 Min Max Mode Operations Modified

Memory Control Signals (cont)

Maximum-mode memory control signals MRDC ndash Memory Read Command 1048729 MWTC ndash Memory Write Command 1048729 AMWC ndash Advanced Memory Write Command

48

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 49: 8086 Min Max Mode Operations Modified

Read and Write Bus Cycle

Read cycle

Minimum-mode memory read bus cycle of the 808849

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 50: 8086 Min Max Mode Operations Modified

Read and Write Bus Cycle (cont)

Read cycle

Minimum-mode memory read bus cycle of the 8086

50

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 51: 8086 Min Max Mode Operations Modified

Read and Write Bus Cycle (cont)

Read cycle

Maximum-mode memory read bus cycle of the 808651

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 52: 8086 Min Max Mode Operations Modified

Read and Write Bus Cycle (cont)

Write cycle

Minimum-mode memory write bus cycle of the 8088 52

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 53: 8086 Min Max Mode Operations Modified

Read and Write Bus Cycle (cont)

Write cycle

Maximum-mode memory write bus cycle of the 808653

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 54: 8086 Min Max Mode Operations Modified

Memory Interface Circuit

Address bus latches and buffers Bank write and bank read control logic Data bus transceiversbuffers Address decoders

54

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 55: 8086 Min Max Mode Operations Modified

Memory Interface Circuit (cont)

Memory interface block diagram 55

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 56: 8086 Min Max Mode Operations Modified

Types of InputOutput

The IO system allows peripherals to provide data or receive results of processing the data Using IO ports

The 80888086 MPU can employ two types of IO Isolated IO Memory-mapped IO

They differ in how IO ports are mapped into the address space

56

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 57: 8086 Min Max Mode Operations Modified

Types of InputOutput (cont)

Isolated inputoutput When using isolated IO in a microcomputer

system the IO device are treated separate from memory

The memory address space contains 1 M consecutive byte address in the range 0000016 through FFFFF16

The IO address space contains 64K consecutive byte addresses in the range 000016 through FFFF16

The bytes in two consecutive IO addresses can be accessed as word-wide data

Page 0 000016 00FF16

Certain IO instructions can only perform in this range

57

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 58: 8086 Min Max Mode Operations Modified

Types of InputOutput (cont)

Isolated inputoutput

80888086 memory and IO address spaces 58

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 59: 8086 Min Max Mode Operations Modified

Types of InputOutput (cont)

Isolated inputoutput

Isolated IO ports 59

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 60: 8086 Min Max Mode Operations Modified

Types of InputOutput (cont)

Isolated inputoutput Advantages

The complete 1Mbyte memory address space is available for use with memory

Special instructions have been provided to perform IO operations with maximized performance

The bytes in two consecutive IO addresses can be accessed as word-wide data

Disadvantages All input and output data transfers must take place

between the AL or AX register and IO port

60

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 61: 8086 Min Max Mode Operations Modified

Types of InputOutput (cont)

Memory-mapped inputoutput MPU looks at the IO port as though it is a storage

location in memory Some of the memory address space is dedicated to IO

ports Instructions that affect data in memory are used

instead of the special IO instructions More instructions and addressing modes are available to

perform IO operations IO transfers can take place between IO port and other

internal registers The memory instructions tend to execute slower

than those specifically designed for isolated IO Part of the memory address space is lost

61

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 62: 8086 Min Max Mode Operations Modified

Types of InputOutput(cont)

Memory-mapped inputoutput

Memory mapped IO ports62

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 63: 8086 Min Max Mode Operations Modified

Isolated InputOutput Interface

IO devices Keyboard Printer Mouse 82C55A etc

Functions of interface circuit Select the IO port Latch output data Sample input data Synchronize data transfer Translate between TTL voltage levels and those

required to operate the IO devices

63

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 64: 8086 Min Max Mode Operations Modified

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8088 system IO interface 64

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 65: 8086 Min Max Mode Operations Modified

Isolated InputOutput Interface (cont)

Minimum-mode interface

Minimum-mode 8086 system IO interface 65

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 66: 8086 Min Max Mode Operations Modified

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8088 system IO interface66

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 67: 8086 Min Max Mode Operations Modified

Isolated InputOutput Interface (cont)

Maximum-mode interface

Maximum-mode 8086 system IO interface 67

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 68: 8086 Min Max Mode Operations Modified

Isolated InputOutput Interface (cont)

Maximum-mode interface

IO bus cycle status codes68

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 69: 8086 Min Max Mode Operations Modified

InputOutput Data Transfer

Inputoutput data transfers in the 8088 and 8086 microcomputers can be either byte-wide or word-wide

IO addresses are 16 bits in length and are output by the 8088 to the IO interface over bus lines AD0 through AD7 and A8 through A15

In 8088 the word transfers is performed as two consecutive byte-wide data transfer and takes two bus cycle

In 8086 the word transfers can takes either one or two bus cycle

Word-wide IO ports should be aligned at even-address boundaries

69

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 70: 8086 Min Max Mode Operations Modified

InputOutput Data Instructions

70

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 71: 8086 Min Max Mode Operations Modified

InputOutput Data Instructions(cont)

EXAMPLE Write a sequence of instructions that will output

the data FF16 to a byte-wide output port at address AB16 of the IO address space

Solution First the AL register is loaded with FF16 as an

immediate operand in the instruction

MOV AL 0FFH Now the data in AL can be output to the byte-

wide output port with the instruction

OUT 0ABH AL

71

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 72: 8086 Min Max Mode Operations Modified

InputOutput Data Instructions(cont)

EXAMPLE Write a series of instructions that will output FF16 to an

output port located at address B00016 of the IO address space

Solution The DX register must first be loaded with the address

of the output port This is done with the instructionMOV DX 0B000H

Next the data that are to be output must be loaded into AL with the instruction

MOV AL 0FFH Finally the data are output with the instruction

OUT DX AL

72

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 73: 8086 Min Max Mode Operations Modified

InputOutput Data Instructions(cont)

EXAMPLE Data are to be read in from two byte-wide input

ports at addresses AA16 and A916 and then output as a word-wide output port at address B00016 Write a sequence of instructions to perform this inputoutput operation

73

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 74: 8086 Min Max Mode Operations Modified

InputOutput Data Instructions(cont)

Solution First read in the byte at address AA16 into AL and

move it into AHIN AL 0AAHMOV AH AL

Now the other byte can be read into AL by the instructionIN AL 09AH

And to write out the word of dataMOV DX 0B000HOUT DX AX

74

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 75: 8086 Min Max Mode Operations Modified

InputOutput Bus Cycles

Input bus cycle of the 8088

75

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 76: 8086 Min Max Mode Operations Modified

InputOutput Bus Cycles (cont)

Output bus cycle of the 8088

76

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 77: 8086 Min Max Mode Operations Modified

InputOutput Bus Cycles (cont)

Input bus cycle of the 8086

77

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78

Page 78: 8086 Min Max Mode Operations Modified

InputOutput Bus Cycles (cont)

Output bus cycle of the 8086

78