Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

College of Computers and Information ‫كلية الحاسبات وتقنية‬

Technology ‫المعلومات‬

8086/8088 Hardware
Specifications

 Pin-Outs and the Pin Functions


 Bus Buffering and Latching
 Bus Timing

Chapter 8
CLO4

Microprocessors & Assembly Language 501326-3


1 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Objectives of Chapter 8
By the end of this chapter, the student will be able
to:

 Describe the function of each 8086 and 8088


pin.
 Connect buffers and latches to the buses.
 Interpret the timing diagrams.

Chapter 8  Explain the difference between minimum


and maximum mode operation.

CLO4

Microprocessors & Assembly Language 501326-3


2 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Introduction
 In this chapter, the pin functions of both the
8086 and 8088 microprocessors are detailed
and information is provided on the following
hardware topics: bus buffering, bus latching,
timing.

 These simple microprocessors are explained as


an introduction to the Intel microprocessor
family.

Microprocessors & Assembly Language 501326-3


3 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Pin-outs and the pin functions


 In this section, we explain the function and
the multiple functions of each of the
microprocessor’s pins.
 In addition, we discuss buffering and latching.

Microprocessors & Assembly Language 501326-3


4 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Pin-outs
 8086 is a 16-bit microprocessor with a
16-bit data bus; 8088 has an 8-bit data
bus.
• 8086 has pin connections AD0–AD15
• 8088 has pin connections AD0–AD7
 Data bus width is the only major
difference.
• thus 8086 transfers 16-bit data more
efficiently
 The figure illustrates pin-outs of 8086 &
Microprocessors & Assembly Language 501326-3
5 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Pin-outs and the pin functions

The pin-out of the 8086 in maximum mode; (b) the pin-out of the 8086 in minimum
mode.
Microprocessors & Assembly Language 501326-3
6 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Pin Connections AD7 - AD0


o 8088 address/data bus lines are
multiplexed
 and contain the rightmost 8 bits of the
memory address or I/O port number
whenever ALE is active (logic 1)
 or data whenever ALE is inactive (logic 0)
o These pins are at their high-impedance
state during a hold acknowledge.

Microprocessors & Assembly Language 501326-3


7 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Pin Connections A15 - A8


o 8088 address bus provides the upper-half
memory address bits that are present
throughout a bus cycle.
o These address connections go to their
high-impedance state during a hold
acknowledge.

Microprocessors & Assembly Language 501326-3


8 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Pin Connections AD15 - AD8


o 8086 address/data bus lines compose
upper multiplexed address/data bus on
the 8086.
o These lines contain address bits A15–A8
whenever ALE is a logic 1, and data bus
connections D15–D8 when ALE is a logic 0.
o These pins enter a high-impedance state
when a hold acknowledge occurs.

Microprocessors & Assembly Language 501326-3


9 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Pin Connections A19/S6 - A16/S3


 Address/status bus bits are multiplexed
to provide address signals A19–A16 and
status bits S6–S3.
 high-impedance state during hold
acknowledge
 status bit S6 is always logic 0,
 bit S5 indicates the condition of the IF flag bit
 S4 and S3 show which segment is
accessed during the current bus cycle.
 these status bits can address four separate
Microprocessors & Assembly Language
501326-3
10
Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Control pens Connections


 Pin Connections RD
 When read signal is logic 0, the data bus is receptive to
data from memory or I/O devices
• pin floats high-impedance state during a hold acknowledge
 Ready
• Inserts wait states into the timing.
– if placed at a logic 0, the microprocessor enters into
wait states and remains idle
– if logic 1, no effect on the operation
Microprocessors & Assembly Language 501326-3
11 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BUS TIMING
 It is essential to understand system
bus timing before choosing memory
or I/O devices for interfacing to 8086
or 8088 microprocessors.
 This section provides insight into
operation
of the bus signals and the basic
read/write timing of the 8086/8088.

Microprocessors & Assembly Language 501326-3


12 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Basic Bus Operation


 The three buses of 8086/8088 function
the same way as any other
microprocessor.
 If data are written to memory of the
processor:
• outputs the memory address on the address
bus
• outputs the data to be written on the data
bus
• issues a write (WR) to memory
• and& Assembly
Microprocessors IO/M= 0 for
Language 8088 13
501326-3 and IO/M = 1 for 8086
Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Simplified 8086/8088 write bus cycle.

Write bus cycle in 8088/8086


Microprocessors & Assembly Language 501326-3
14 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Basic Bus Operation


 If data are read from the memory of
the microprocessor:
• outputs the memory address on the
address bus
• issues a read memory signal (RD)
• and accepts the data via the data bus
 See simplified timing for read in next
slide.

Microprocessors & Assembly Language 501326-3


15 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Simplified 8086/8088 write bus cycle.

Read bus cycle in 8088/8086


Microprocessors & Assembly Language 501326-3
16 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS And DOS Programming


In Assembly

 BOIS INT 10H Programming


 DOS INT 21H Programming

Chapter 9
CLO5

Microprocessors & Assembly Language 501326-3


17 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

Objectives of Chapter 9
By the end of this chapter, the student will be able
to:
 Use INT 10H function calls to:
 Clear the screen
 Set the cursor position
 Draw lines on the screen in graphics mod
 Change the video mode
 Use INT 21H function calls to:

Chapter 9 

Input characters from the keyboard
Output characters to the screen
 Input or output strings

CLO5

Microprocessors & Assembly Language 501326-3


18 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

What is the Interrupt


 In many applications there is a need to perform
a bitwise rotation of an operand.
 There are some extremely useful subroutines
within BIOS and DOS that are available to the
user through the INT (interrupt), instruction.
 The INT instruction is somewhat like a FAR call.
When it is invoked, it saves CS:IP and the flags
on the stack and goes to the subroutine
associated with that interrupt.
 The INT instruction has the following format:

INT xx ;the interrupt number xx can be 00 -


FFH
Microprocessors & Assembly Language 501326-3
19 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


PROGRAMMING
 INT 10H subroutines are burned into the ROM BIOS of the
80x86-based IBM PC and compatibles and are used to
communicate with the computer's screen video.
 Much of the manipulation of screen text or graphics is
done through INT 10H.
 There are many functions associated with INT 10H.
Among them are changing the color of characters or the
background color, clearing the screen, and changing the
location of the cursor. These options are chosen by
putting a specific value in register AH.
 In this section we show how to use INT 10H to clear the
screen, change the cursor position, change the screen
color, and draw lines on the screen.
Microprocessors & Assembly Language 501326-3
20 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


 PROGRAMMING
Monitor screen in text mode
 The monitor screen in the IBM PC is divided into 80
columns and 25 rows in normal text mode
 This is the case for all monitors regardless of whether
they are color or monochrome, as long as they are in text
mode.
 The mode can be changed, depending on the type of the
monitor. Monitor types include MDA, CGA, EGA, and VGA.
The text screen is 80 characters wide by 25 characters
long. Since both a row and a column number are
associated with each location on the screen, one can
move the cursor to any location on the screen simply by
changing the row and column values.

Microprocessors & Assembly Language 501326-3


21 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


 PROGRAMMING
Monitor screen in text mode
 The 80 columns are numbered from 0 to 79 and the 25
rows are numbered 0 to 24. The top left corner has been
assigned 00,00 (row = 00, column = 00).
Decimal Hex
00,00 00,79 00,00 00,4F

screen center screen center


12,39 0C,27

24,00 24,79 18,00 18,4F

Microprocessors & Assembly Language 501326-3


22 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


 PROGRAMMING
Clearing the screen using INT 10H
function 06H
 To use INT 10H to clear the screen, the following registers
must contain certain values before INT 10H is called: AH =
06, AL = 00, BH = 07, CX = 0000, DH = 24, and DL = 79.
The code are:

MOV AH,06 ;AH=06 to select scroll function


MOV AL,00 ;AL=00 the entire page
MOV BH,07 ;BH=07 for normal attribute
MOV CH,00 ;CH=00 row value of start point
MOV CL,00 ;CL=00 column value of start point
MOV DH,24 ;DH=24 row value of ending point
MOV& Assembly
Microprocessors DL,79 Language ;DL=7923
501326-3 column value of end point
Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


 PROGRAMMING
Clearing the screen using INT 10H
function 06H
 Option AH = 06 of INT 10H is in reality the "scroll window
up" function; therefore, one could use that to make a
window of any size by choosing the values for the start
and end rows and columns.
 However, to clear the screen, the top left and bottom right
values are used for start and stop points in order to scroll
up the entire screen. It is much more efficient coding to
clear the screen by combining some of the lines above as
follows:
MOV AX, 0600H ;scroll entire screen
MOV BH, 07 ;normal attribute
MOV CX, 0000 ;start at 00, 00
MOV& Assembly
Microprocessors DX, Language
184FH 501326-3 ;end
24 at 24, 79 (hex =Dr.18, 4F)
Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


 PROGRAMMING
Setting the cursor to a specific location
using INT 10H function 02:
 INT 10H function AH = 02 will change the
position of the cursor to any location.
 The desired position of the cursor is identified by
the row and column values in DX, where DH =
row and DL = column.
 Video RAM can have more than one page of text,
but only one of them can be viewed at a time.
When AH = 02, to set the cursor position, page
zero is chosen by making BH = 00.

Microprocessors & Assembly Language 501326-3


25 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


 PROGRAMMING
Example 7-29
Write the code to set the cursor position to row
=15 = 0FH and column = 25 = 19H.

Solution:

MOV AH,02 ; set cursor option


MOV BH,00 ; page 0
MOV DL,25 ; column position
MOV DH,15 ; row position
INT 10 ; invoke interrupt 10H

Microprocessors & Assembly Language 501326-3


26 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


 PROGRAMMING
Example 7-30
Write a program that (1) clears the screen and (2)
sets the cursor at the center of the screen.
Solution:

;clearing the screen


MOV AX, 0600H ;scroll the entire page
MOV BH, 07 ;normal attribute
MOV CX, 0000 ;row and column of top left
MOV DX, 184FH ;row and column of bottom
right
INT 10H ;invoke the video BIOS service

Microprocessors & Assembly Language 501326-3


27 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS INT 10H


PROGRAMMING
;setting the cursor to the center of screen
MOV AH, 02 ;set cursor option
MOV BH, 00 ;page 0
MOV DL, 39 ;center column position
MOV DH, 12 ;center row position
INT 10H ;invoke interrupt 10H.

Microprocessors & Assembly Language 501326-3


28 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 INT 21H is provided by DOS in contrast to INT 10H, which
is BIOS-ROM based
 When MS-DOS is loaded into the computer, INT 21H can
be invoked to perform some extremely useful functions.
 In this section we use only the options dealing with
inputting information from the keyboard and displaying it
on the screen.
 In previous chapters, a fixed set of data was defined in
the data segment and the results were viewed in a
memory dump.
 Data will come from the keyboard and after it is
processed, the results will be displayed on the screen.

Microprocessors & Assembly Language 501326-3


29 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 Outputting a string of data to the monitor
using INT 21H option 09:
 INT 21H can be used to send a set of ASCII data
to the monitor. To do that, the following registers
must be set: AH = 09 and DX = the offset
address of the ASCII data to be displayed. Then
INT 21H is invoked. The address in the DX is an
offset address and DS is assumed to be the data
segment.
 INT 21H option 09 will display the ASCII data
string pointed at by DX until it encounters the
dollar sign "$".
Microprocessors & Assembly Language 501326-3
30 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 Outputting a string of data to the monitor
using INT 21H option 09:
 For example, to display the message "The earth
is but one country", the following is from the
data segment and code segment.

DATA_ASC DB “The earth is but one country”,”$”


MOV AH, 09 ;Option 09 to display string of
data
MOV DX, OFFSET DATA_ASC ;DX= offset address of
data
INT 21H ;invoke the interrupt

Microprocessors & Assembly Language 501326-3


31 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 Outputting a single character to the
monitor using INT 21H option 02:
 There are occasions when it is necessary to output to the
monitor only a single character.
 To do that, 02 is put in AH, DL is loaded with the character
to be displayed, and then INT 21H is invoked. The following
displays letter "J".
MOV AH,02 ;option 02 displays one character
MOV DL, “J” ;DL holds the character to be
displayed
INT 21H ;invoke the interrupt
 This option can also be used to display '$' on the monitor
since the string display option (option 09) will not display
'$'.
Microprocessors & Assembly Language 501326-3
32 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 Inputting a single character, with echo
using INT 21H option 01:
 This functions waits until a character is input
from the keyboard, then echoes it to the monitor.
 After the interrupt, the input character will be in
AL.

MOV AH, 01 ;option 01 inputs one character


INT 21H ;after the interrupt, AL = input character
(ASCII)

Microprocessors & Assembly Language 501326-3


33 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 Example 7-33:
The following program will accept up to six characters from
the keyboard, including the return (carriage return) key.
Six locations were reserved for the buffer and filled with
FFH.
ORG 0010H
DATA1 DB 6,?,6 DUP(FF) ;0010H=06, 0012H to
0017H = FF
MOV AH, 0AH ;string input option of INT
21H
MOV DX, OFFSET DATA1 ;load the offset address of
buffer
INT 21H ;invoke interrupt 21H
0010 0011 0012 0013 0014 0015 0016 0017
The following
06 ? shows
FF the memory
FF FFcontents
FF of FF
offset 0010H:
FF

Microprocessors & Assembly Language 501326-3


34 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 When this program is executed, the computer
waits for the information to come in from the
keyboard. When the data comes in, the IBM PC
will not exit the INT 21H routine until it
encounters the return key.
 Assuming the data that was entered through the
keyboard was “TAIF" <RETURN>, the contents of
memory locations starting at offset 0010H would
look like this:
0010 0011 0012 0013 0014 0015 0016 0017
06 04 54 41 49 46 0D FF
T A I F CR

Microprocessors & Assembly Language 501326-3


35 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

DOS INTERRUPT 21H


 Inputting more than the buffer size
 Now what happens if more than six characters
(five, the maximum length + the CR = 6) are
keyed in? Entering a message like “TAIF, Saudi
Arabia" <RETURN> will cause the computer to
sound the speaker and the contents of the buffer
will look like this:

0010 0011 0012 0013 0014 0015 0016 0017


06 05 54 41 49 46 2C 0D
T A I F , CR

Microprocessors & Assembly Language 501326-3


36 Dr. Mohamed Abdelaziz
College of Computers and Information ‫كلية الحاسبات وتقنية‬
Technology ‫المعلومات‬

BIOS & DOS INTERRUPT


SUMMARY
INT 10H Video Function Calls INT 21H Dos Function Calls
AH Function AH Function
02 Set cursor position 01 Keyboard input with echo

Additional Call Registers Result Registers Additional Call Registers Result Registers
BH = page number None None AL=input character
DH = row
DL = column

06 Scroll window up (Clear Screen) 02 Output character to monitor

Additional Call Registers Result Registers Additional Call Registers Result Registers
AL= page number None DL = character to be displayed None
BH = display attribute
CH = x coordinate of top left
CL = y coordinate of top left
DH = x coordinate of lower right
DL = y coordinate of lower right

09 String output

Additional Call Registers Result Registers


DS:DX = string address None

0A String input

Additional Call Registers Result Registers


DS:DX= address which to store string None

Microprocessors & Assembly Language 501326-3


37 Dr. Mohamed Abdelaziz

You might also like