Microprocessor 8086 Ssi
Microprocessor 8086 Ssi
By
Dr. Sikder Sunbeam Islam
Associate Professor
Department of Electrical and Electronic Engineering
International Islamic University Chittagong
Introduction:8086 Features
8086 is Intel‟s first 16 bit Microprocessor
HMOS technology based
Packaged in 40-pin DIP(Dual in line package)
5V Power Supply
Cloak Speed: 5 MHz (up to 8MHz)
Has 20-bit address bus, hence it can address
up to of memory. Use segmented
memory
External clock generator (such as Intel 8284)
chip is needed.
Introduction:8086 Features
continues
Has 16 bit data bus
Can be configured as (i) uni-processor
and (ii) multi-processor system (Bus
controller 8288 chip needed).
6 Instructions can be prefetched from
program memory and queues them in
order to speed up instruction
execution.
8086 Architecture
The 8086 CPU is internally divided into
two independent functional units:
BX Resister(Base Register) :
It is called base Register because it sometimes holds
the offset address of a location in the memory
system in all version of microprocessor .
EU Registers:
CX Resister(Counter Register) :
It is known as “Counter Register” because some
instructions such as SHIFT, ROTATE and LOOP
use the content of CX or CL as a counter.
Example: The instruction LOOP START will
automatically decrement CX by 1 without
affecting the flags and will check if [CX]=0 to
stop the loop.
DX Resister(Data Register) :
This general purpose register holds a part of the
result from multiplication or part of the dividend
before a division and reminder after the division.
EU Registers: Flag Register
A flag register is flip flop that indicates some
condition produced by the execution of an
instruction or controls certain operations of the EU.
A 16-bit flag register contains 9 active flags.
Some flag changes after many arithmetic and logic
operations.
Flag never changes for any data transfer or
program control instruction/operation.
Six of the nine flags are used to indicate some
condition produced by an instruction. Let us now
discuss these flags:
EU Registers: Flag Register
Flag Register: Conditional flags
C (Carry) flag: This flag is set if a carry after addition or
the borrow after subtraction that has been generated out
of the most significant bit position during the last
result calculation. The carry flag also indicates error
condition, as dictated by some programs and procedures.
P (parity): This flag is set if the result has even parity
(number of „1‟ bits) ; it is zero if odd parity results.
For example, if a number contains three binary one bits, it
has odd parity.
A(auxiliary carry): It is set if the carry (half carry) after
addition or the borrow after subtraction between bit
position 3 and 4 of the result. This flag is used by BCD
arithmetic instruction (like, DAA). Otherwise, the A is zero.
Flag Register: Conditional flags
Z(Zero): This flag is set if the result of an
arithmetic or logic operation is zero. If Z=1, the
result is zero; if Z=0, the result is not zero.
S (Sign): This flag is set if most significant bit of
the result is one; otherwise it is zero.
O (Overflow): Overflows occur when signed
numbers are added or subtracted. An overflow
indicates that the result has exceeded the capacity of
the machine or destination location.
Problem/Q: Suppose that an 8 bit microprocessor has a 16 bit stack pointer and uses
a 16 bit register in order to access the stack from the bottom. Assume that initially
the stack pointer and the 16 bit register contain 20C5 and 0120 respectively. After
a PUSH operation what are the contents of the stack pointer? What are the contents
of 20C6 and 20C7?
BIU: Stack Seg: PUSH & POP instructions
Examples:
PUSHA; (Push all)—copies the content of the internal register
set ( following order AX,CX,DX, BX,SP,BP,SI and DI ), except
segment registers to stack.
PUSH ‘A’; pushes 0041 H (ASCII code of „A‟) to stack.
PUSHF; (Push flag)—copies the content of the Flag register to
stack.
PUSH BX, the first byte of data copied to stack (memory location
addressed by SP in the stack segment) .
POP BX; the first byte of data removed from stack (memory
location addressed by SP in the stack segment) into register BL.
POPA; (POP all), reverse of PUSHA.
POPF; reverse of PUSHF.
POPCS; not valid
POP 1000H—not valid.
PUSH & POP
instructions
Examples:
PUSHA; (Push all)
PUSHF; (Push flag)
Stack: Two Pointer Registers
Two pointer registers are used to access data in the
stack segment (SS) remains in EU:
Stack Pointer (SP) register is used as an offset (to
store data at stack memory) from the current SS
during execution of an Instruction. Its content is
automatically updated due to execution of a POP or
PUSH instruction.
Base Pointer (BP) register points to the memory
location for memory data transfer. BP contains an
offset address in the current SS. This offset is used in
based addressing mode.
BP may be considered as user stack pointer while
SP is the system stack pointer (as SP used by some
8086 instruction automatically like, CALL)
BIU: Segment Registers
Extra Segment (ES) register and Data
Segment (DS) register are used to hold
the starting address of the two memory
segments that are used for data.
From DS-register operands for most
instructions are fetched.
ES-register points to the extra segment in
which extra data is stored. String
instruction uses ES and DS to find 20-
bit physical address for the destination.
Two Index Registers
Two Index registers remains in EU: Source
Index (SI) and Destination Index(DI).
String Instruction uses SI and DI registers
together with DS and ES respectively in order to
distinguish between source and destination
addresses.
Addressing Modes
There are various techniques to specify
address of data. These techniques are called
Addressing Modes.
The 8086 provides various addressing modes
to access instruction operands.
The 8086 has 12 addressing modes. These
modes can be classified into five groups:
Addressing Modes: Register and
Immediate addressing mode
Register Addressing Mode: Register addressing transfers a
copy of a byte or word from the source register to destination
register. Example:
Addressing Modes: Memory Addressing
Mode
Register Indirect Addressing: Register addressing
transfers a byte or word between a register and memory
location addressed by an index or base register
(SI,DI,SP,BP).