You are on page 1of 31

Microprocessors 8088/8086

Chapter #1
Quick Review

Ayad M. Kwad Al-Awsi

Al - Iraqia University
Engineering College Department of Networks engineering

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 1 / 31


Introduction

Textbooks and References


The 8088 and 8086 Microprocessors; Programming,
Interfacing, Software, Hardware and application by Walter A.
Triebl & Avtar Singh
THE INTEL MICROPROCESSORS 8086/8088,
80186/80188, 80286, 80386, 80486, Pentium, Pentium Pro
Processor, Pentium II, Pentium III, Pentium 4, and Core2 with
64-Bit Extensions by BARRY B. BREY
iAPX 86, 88 USER’S MANUAL by intel
iAPX 88 BOOK WITH AN INTRODUCTION TO THE
iAPX 188 by intel
8088 data sheet by intel
8086 data sheet by intel

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 2 / 31


Introduction

The history review for processors and computers can be found in the
COA and microprocessors books, and how computers were
transfered from mechanical to electrical and finally to electronic ages.
But, in this lectures we will focus on the 8088/8086 processors and
their operations (how did they work? and how can we use them? from
view point of programmer with some electronic considerations that
make them work perfectly.)

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 3 / 31


Introduction

 Number Systems
Using of the microprocessor requires a specific knowledge about binary,
decimal, and hexadecimal numbering systems; and how to convert from
system to another.
 Digits
Before converting numbers between bases, digits of a number system
must be understood.
First digit in any numbering system is always zero.
A decimal (base 10) number is constructed with 10 digits: 0
through 9.
A base 8 (octal) number; 8 digits: 0 through 7.
A base 2 (binary) number; 2 digits: 0 and 1.
A base 16 number contains 10 digits: 0 through 9, followed by A
through F as substitution for Numbers from 10 to 15.
Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 4 / 31
Introduction

Note that: The decimal number system does not contain a 10 digit
and the octal system number does not contain an 8 digit and so on.
 Positional Notation
Once digits are understood, larger numbers are constructed using
positional notation.
Position to the left of the units position is the tens position.
left of tens is the hundreds position, and so forth.
An example is decimal number 154.
this number has 1 hundred, 5 tens, and 4 units
1 5 4
100 10 1
So, exponential powers of positions are critical for understanding
numbers in other systems.
Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 5 / 31
Introduction

Exponential values of each position for decimal system are:


the units position has a weight of 100 , or 1.
tens position has a weight of 101 , or 10.
hundreds position has a weight of 102 , or 100.
and so on...
The position to the left of the decimal point is always the units
position in decimal system and any number system; so:
position to left of the binary point always 20 , or 1
position left of the octal point is 80 , or 1
Any number raised to zero power is always one (1), or the units
position.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 6 / 31


Introduction

Position to the left of the units position always the number base
raised to the first power.
in a decimal system, this is 101 , or 10.
binary system, it is 21 , or 2, and so forth.
11 in decimal has different value from 11 in binary .
In decimal

1 1
101 + 100 = 11 decimal

But, in binary:

1 1
21 + 20 = 3 decimal

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 7 / 31


Introduction

positions to the right of the (decimal, binary, octal, hexadecimal,...)


point have negative powers.
First digit to the right of the decimal point has a value of 10−1 , or 0.1.
In the binary system, the first digit to the right of the binary point has
a value of 2−1 , or 0.5.
All numbering Systems have the same property.
For example, the number 110.1012

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 8 / 31


Introduction

 Conversion to Decimal
To convert from any number system to decimal one, firstly, we must
determine the weights or values of each position of the number.
Then, Sum the weights to form the decimal equivalent, as example
above.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 9 / 31


Introduction

 Conversion from Decimal


Conversions from decimal to other number systems more difficult to
accomplish.
first Whole number conversion from decimal
1 Divide the decimal number by the radix (number base).
2 Save the remainder (first remainder is the least significant digit).
3 Repeat steps 1 and 2 until the quotient is zero.

For example, to convert a 10 decimal to binary

Now, to convert a 10 decimal to octal what is the result? Think!!!


Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 10 / 31
Introduction

second Converting from a Decimal Fraction


1 Multiply the decimal fraction by the radix (number base).
2 Save the whole number portion of the result (even if zero) as a
digit.
Note that the first result is written immediately to the right of the
radix point.
3 Repeat steps 1 and 2, using the fractional part of step 2 until the
fractional part of step 2 is zero.
Noteworthy some numbers are never-ending (repetend).

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 11 / 31


Introduction

For example; 0.125 decimal is converted to binary

This same technique is used to convert a decimal fraction into any


number base.
Now, to convert a 0.125 decimal to octal what is the result?
Think!!!

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 12 / 31


Introduction

 Binary-Coded Hexadecimal
1 Binary-Coded Hexadecimal (BCH) is a hexadecimal number
written, each digit is represented by a 4-bit binary number.
2 BCH code allows a binary version of a hexadecimal number to be
written in a form easily converted between BCH and hexadecimal.
3 Hexadecimal represented by converting digits to BCH code with a
space between each digit.
Example
3 A C = 0011 1010 1100
and
0111 0011 1110 . 1101 = 73E.D

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 13 / 31


Introduction

 Complements
At times, data are stored in complement form to represent negative
numbers. There are two systems:
1 radix-1 complement (earliest)
one’s complement fifteen’s complement
e.g. 8-bit binary number 01001100 the fifteen’s (radix -1)
is one’s (base-1) complemented to complement of a 5CD
represent it as a negative value; hexadecimal is;
1111 1111 15 15 15
– 0100 1100 –5 C D
1011 0011 A 3 2

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 14 / 31


Introduction
2 radix complement
To form the radix complement, first find the radix -1 complement,
and then add a one to the result
two’s complement sixteen’s complement
e.g. 0100 1000 is converted to a first fifteen’s complement is
negative value by two’s (radix) found, and then by adding one to
complementing; the result to form the sixteen’s
complement e.g 345H;
1111 1111
– 0100 1000 15 15 15
1011 0111 (one’s complement) – 3 4 5
+ 1 C B A (fifteen’s complement)
1011 1000 (two’s complement) + 1
C B B (sixteen’s complement)
Note: to ensure that the result number is negative add to origin one
and ignore the carry.
Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 15 / 31
Introduction
 Computer Data Format
Successful programming requires a precise understanding of data
formats.
Commonly, data appear as ASCII, Unicode, BCD, signed and
unsigned integers, and floating-point numbers (real numbers).
Other forms are available but are not commonly found.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 16 / 31


Introduction
ASCII and Unicode Data
ASCII (American Standard Code for Information Interchange) data
represent alphanumeric characters in computer memory.
Standard ASCII code is a 7-bit code. eighth and most significant bit
used to hold parity
If ASCII data are used with a printer, most significant bits are 0 for
alphanumeric printing; 1 for graphics.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 17 / 31


Introduction
Extended ASCII characters
In PC, an extended ASCII character set is selected by placing 1 in the
leftmost bit, so using code from 80H to FFH. It is Used to store:
Some foreign letters and punctuation.
Greek & mathematical characters.
box-drawing & other special characters.
Extended characters can vary from one printer to another.
ASCII control characters perform control functions in a computer
system.
clear screen, backspace, line feed, etc.
Enter control codes through the keyboard.
hold the Control key while typing a letter.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 18 / 31


Introduction

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 19 / 31


Introduction
Many Windows-based applications use the Unicode system to store
alphanumeric data, which store each character as 16-bit data.
Codes 0000H–00FFH are the same as standard ASCII code.
Remaining codes, 0100H–FFFFH, store all special characters from
many character sets.
Allows software for Windows to be used in many countries around
the world.
For complete information on Unicode, visit: http://www.unicode.org

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 20 / 31


Introduction
BCD (Binary-Coded Decimal) Data
The range of a BCD digit extends from 00002 to 10012 , or 0–9 decimal,
stored in two forms:
Stored in packed form:
- packed BCD data stored as two digits per byte;
- used for BCD addition and subtraction in the instruction set of
the microprocessor
Stored in unpacked form:
- unpacked BCD data stored as one digit per byte.
- returned from a keypad or keyboard.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 21 / 31


Introduction
Applications requiring BCD data are point-of-sales terminals.
Also devices that perform a minimal amount of simple arithmetic.
If a system requires complex arithmetic, BCD data are seldom used.
There is no simple and efficient method of performing complex BCD
arithmetic.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 22 / 31


Introduction
 Byte-Sized Data
Difference in these forms is the weight of the leftmost bit position.
- value 128 for the unsigned integer
- minus 128 for the signed integer
In signed integer format, the leftmost bit represents the sign bit of
the number.
- also a weight of minus 128

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 23 / 31


Introduction
Unsigned integers range from 00H to FFH (0–255)
Signed integers from –128 to 0 to + 127.
Negative signed numbers represented in this way are stored in the
two’s complement form.
Evaluating a signed number by using weights of each bit position
is much easier than the act of two’s complementing a number to
find its value.
- especially true in the world of calculators designed for
programmers

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 24 / 31


Introduction
 Word-Sized Data
A word (16-bits) is formed with two bytes of data.

- The least significant byte always stored in the lowest-numbered


memory location.
- Most significant byte is stored in the highest.
- This method of storing a number is called the little endian
format.
- Alternate method is called the big endian format.
- Numbers are stored with the lowest location containing the most
significant data. Not used with Intel microprocessors.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 25 / 31


Introduction
For Example; if we have number 1234H appears when stored in the
memory locations 3000H and 3001H

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 26 / 31


Introduction
 Doubleword-Sized Data
Doubleword-sized data requires four bytes of memory because it is a
32-bit number.
- appears as a product after a multiplication.
- also as a dividend before a division.
Define using the assembler directive define doubleword(s), or DD.
- also use the DWORD directive in place of DD.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 27 / 31


Introduction

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 28 / 31


Introduction
 Real Numbers
Since many high-level languages use Intel microprocessors, real
numbers are often encountered.
A real, or a floating-point number contains two parts:
- a mantissa, significant, or fraction
- an exponent.
A 4-byte number is called single-precision.
The 8-byte form is called double-precision.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 29 / 31


Introduction
For example, if 12 is converted to binary (11002 );
It is normalized and the result is 1.1 × 23 . The whole number 1 is
not stored in the 23-bit mantissa portion of the number; the 1 is
the hidden one-bit.
The exponent is stored as a biased exponent. With the
single-precision form of the real number, the bias is 127 (7FH) and
with the double-precision form, it is 1023 (3FFH).
The bias and exponent are added before being stored in the
exponent portion of the floating-point number.
In the previous example, there is an exponent of 23, represented as a
biased exponent of 127+3 or 130 (82H) in the single-precision form, or
as 1026 (402H) in the double-precision form.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 30 / 31


Introduction
Note That; There are two exceptions to the rules for floating-point
numbers.
The number 0.0 is stored as all zeros.
The number infinity is stored as all ones in the exponent and all
zeros in the mantissa.
* The sign-bit indicates either a positive or a negative infinity.

Ayad M. Kwad Al-Awsi (AIU) Microprocessors 8088/8086 31 / 31

You might also like