Intel 8086 Architecture, Features & Signals
Intel 8086 Architecture, Features & Signals
32ARCHITECTURE OF 8086 hb l
The functional block diagram of the 8086 is shown in Fig.13.1. It is subdivided
Imto the following two units:
() An execution unit (EU), which includes the ALU, eight 16-bit general-
purpose registers, a 16-bit flag register, and a control unit.
bus interface unit (BIU), whichincludes an adder for address calculations,
instruction
four 16-bit segment registers (CS, DS, SS, and ES), a 16-bit
pointer (IP), a six-byte instruction queue, and bus control logic.
21 Execution Unit
he EU COnsists of eight 16-bit general-purpose registers-AX, BX, CX, DX,
,BP, SI, and DI. Among these registers, AX, BX, CX, and DX
can befurther
register beanddivided 420
(V) (iv) while(iii) (1) ) used
DL,
SP: shifturotate
the and DX: executed
thedataused The usedstringCX/CL: instructions.
technique, ItBX: divide, adjustment AX/AL: DX BX MICROPROCESSORS
is has
respectively, to into
item count to also The the store
two DH CH RH Ak
The /O a DX
part instructions Temporary
register
device
SP is hold CX used BX andfollowing
AX 8-bit Fiags
of has when with input/output 8-bit datALbusUa
register the used to value the is register or AND
to Fig. B AL
address
shifted/rotated to be the ALregisters-AH or as
dividend indicates count used the refer
16-bit 13.1
or (REP/REPE/REPNE)
instruction
hold L0OP CL
istohelp special
is shown MICROCONTROLLERS
holds used Execution
(EuniU)t registersGeneral
the while da value hold of to (VO) data Functional
stack before part the the the th e functions: in
valuethe as Systemcontrol EU
executing of number while XLAT dataoffset operations, the during Fig. and
pointer tahe count block
division inaccumulator. 13.l. AL,
result when executing program diagram
is instruction. address the Bus
is the times of The BH
Used andINduring and memory and interfacing-123456KInstruction
queue
operation, the of general-purpose and of byteSisx Adder
to and the inexecution. the bits16 ES DS
It bits16
a the the LOOP a BL, 8086 unit
hold OUT location some is (BIU) Address
bus
used
shiftUrotateexecuting using
the It same CH bits20
is decimal bits16
instruction. th e In and
in
multiplicinatstiornuctionumber
n
offset also
instructions. in addition, System
Control Bus
code the look-up the the registers CL,
of and
ASCImultiply,
tim es has repeated memory. and
ad res usopered ation instructions.
of h ol
to useis
d d the to
be
abi each can DH
(vi) thsieg()
n (iv) W) operation instruction. status The
) Wate: Section
13.2.2.in in be or
fla gs The DIS T he the 64(vi) (vi) (i)
negative.
TF or SF 0SZF POston
Wie dter Ar0dd borrow PF CF of flags Bits KBstack Here,
the
memory instructions.
string
(rap logie zero, of the CF, marked
fla g the DI:
(sign (zero value (auxiliarynumber(parity (carry
subtraction The D14|DI3DI2|D11DIo memoryaddres fora and
ofinfssettructions. offset aSI:d res BP: duringregister
data
after
the result PF, in
the
register in the
term
instructionflag): flag):
flag): Z=1,
If in 0).
flag): CPU. flags '--Intel-reserved addres The addres The The the
program DI SI ofBP to
ALThis flag): divisible decide
stored at
of an that AF, flag hexadecimal minimum segment A
carry IF
DF
OF of register register regitheexecut
of ster ion of data
SFthe ZF after flag of 1s), If8-bit CFThe DE, isregister ZE, the is the the
TF holdsindicates
PF the Fig . stored. to the thoep INTEL
is result th e functions
holds
or
I
obtainedF , SF, 8086 by refers is source is
is a is flag): lower 13. 2 size destination be
is of
address
BCD used bits is 16-bit and and can 16. called 8086
usedexecuted. D9 is form can In tos called readcalled the of
isthat AFset the Thi s MICROPROCESSOR
the
to shown is the data PUSH
to arithmetic zero addition by in subtraction
holds
eight carry of TF after OFbe Flag bits ZF
SF
TF D8 beportion a destination source from base at
t th e 0. ar e classified
are means in stack
the Otherwise, the register
(normally XXXXOH. even 8086, data which
debug If and the
e D7 in the pointer. or
S after called thcalled in
or segment.
=
result orDAA bit the bits different
if position of execution of Fig . that 1 th e of data indexwritten POP the
subtraction, D6 byte. the thindex
e ARCHITECTURE,
a the 0, Z=0, of or carry operation. the the thmaximum
e
ancontrol status into set 13. 2 . reasonThe extra segment,register.instruction, It data
program sign the the
of an the it
result 8-bit flags status 8086 to0) D5 starting memory register. into is
3 is segment also is SP
arithmetic DAS (the after set or flags, flags,
of AF D4 segment, the to is
bitresult result are an flags used FEATURES,
is respectively. addition
LSB tohave 16-bit addresS size while It
stack used be
using instruction I. an as
arithmetic as D3 thfiosr where It respectively.
is
0after is or always of is topushed along
an d not is odd
follows: theyas they and PF- D2DI while executing
used used
the lo gic or addition athe segment. hold AND
the an zero. control is of segment
control indicate with SIGNALS
treated the
parity explained begins
a data, executing to to the or
single-step ariresulthmet or segment hold hold popped, the
t ic operation adjustto borow as or logic flags. CF code,
(i.e., DO at can string the offset
is bit th e th e the the SS 421
a
ONTRDAFRS
422 MWAAS
te thecode segment
ie.,TE l), RO86 gets ddressof
technique, If itisset executionof each
Mep interruptj
afterthe
trapping or
iritermuptheed
instruction in
sddinefour binary(%
byhexadecimal digit 0)
detaigging feature
vH) DF
direction
TF Oj,
Sl
the
iscleared(ie,Ag) DE selects either the
register,
the Dl and/or are automatically
increment
during the execution of
or
string
ydeectgeratm content
ddressis
ete
akressofthe
Therefore, the
ofCS.
2000H. Similarly.
dataasegment,
0,the registers incremented,
decremented,This flag can be set and
if D
he hase and extra segment
wrert
automatically
and C1D
instrsctions,
Aag): IF
respectively.
controls the operation of the
leared usirnegistthse Stt%e e segment,
K000H, and 8000OH.
epectivelyFigure
13.3shows the
fvHi) IF
(interrupt
the8086. HIF0, INTR inter up pjn g
the INTR pin is disabled and if 1F 1, the
set and cleared Using the STI
bation
these
of
segments in the
serent
2000H 4000H
SS
explained in Chapter
14 (Section 14.2). ES DI for string instructions
6000H 8000H
MICROCONTRCLLERS INTEL A086
MICROPROCESSORSAND MICROPROCESSOR A
424
byteof AX) is pushed into
the offset
ARCHTECTURE, FEATURES, ANO SIGNALS 425
Example13,2: memory in
The fetching of an
instnuction from the the 8086 is
(upper
segment,as
againdecremented by
stack
shown in Fig. 13.5 (a),.
I (ie.. SP
address specified by SP in the
example. thatthe CS
registerhas the value 3000H and SPis (lower
byte of AX) is pushedlinto 0103H) and the
Let us assume fetch aninstructionfromthe
shown in Fig. 13.5the(b).offset addresScontent theby ALSP
ri register of
To memory, the
the value 2000H.from which the next instruction is to be thestack
segment, as
specified
CSx10H
address
memory 30000HBase address ofthe code
+1P= 2000H
-0ffsetaddress
fe tched, fol owg
segment s
in
Mermory Address
32000H-- Memory address from wherethe next
Example13.3:
Let us sec the
fetching of data from the memory using the DS
instnuctioM 0s
taken
AH
JCH
AL
2BH SP a1044
stack segment(SS X
10H)
withanexample.
Consider the execution of the instruction MOVand BX
instructionBX indicates AX,that (BrX)eis,tery
3CH
around BX in thËs 301944SSX10H+SP)
The square bracket the memory; the
Specified by the BX register is in register he
fromholds the ala
The
segment. data obtained
address of the datain the data
moved to the AX register. Let us
assume that DS and BX the oi sa is
and 3000H, respectively. To
thhe
calculate the memory address from
have
memo
values I00ry a
has to be taken, the CPUdoes the following operation: where the data Memory
Address
DS x 10H =10000H’ Base address of the data segment
+BX= 3000H Offset address
AL 3OCOOH SSX10H)
13000H Memoryaddress from where the AH
datais taken
This is also explained in Fig. 13.4. 3CH 2BH
SP =0103H
Memory
Address 2BH
30103H SSX 10H+SP)
3CH
30104H
AH AL 10000H
4BH 3AH 3000H (offiset)
(b)
Eio. 13.5 PUSH AX: (a) pushing the first byte of AX onto the stack segment (b) pushing the
3AH 13000H
4BH
second byte of AX onto the stack segment
130014
The instruction queue is six bytes long and stores the pre-fetched instructions
from the code segment. From there, the instruction is taken to the instruction
1byte decoder, where it is decoded. The decoder passes the decoded information to the
timing and control circuit, which in turn generates the various control signals to
execute the instruction. Whenever this decoded instruction requires branching
Fig. 13.4 Execution of the instruction MOV AX, [BX] (Which arises when conditional or unconditional jump instructions are decoded),
Example 13.4: he instruction queue is flushed and the instruction bytes from the branch address
Let us see the pushing of data into the stack segment using the PUSH re tetched into the queue. The BIU fetches the instruction bytes from the memory
with an example. instruciol, Wnenever the EU is not using the address/data bus and puts them in the instruction
queue. Fetching and execution of instructions can take place simultaneously. Thus
Assume that the SS and SP registers have the values 3000H and 0105H, theinstruction queue reduces the execution time of a program.
respectively. Consider the execution of the instruction PUSH AX bythe 8086.The allows
steps carried out by the The
segment and offset mechanis1m for accessing the memory in the 8086
8086 to execute the PUSH AX instruction areasfollows structures, Arelocatable
i) SP is
decremented by 1(i.e., SP=0104H) and thecontent of the AH register programmer to write relocatable programs or data
memory map
program or data structure is one that can be placed anywhere in the
MICROCONTROLLERS
MCROPROCESSORSAND INTEL 8n96
426 MICROPROCES9OR
and executed
without any
modification
This
is not addresssignals A19-A16
ARCHTECTURE,
and the status bits FEATURES SIONALS 427
MNO
of the 8086
microprocessor. In a relocatable program, the jump
possible
instructions the pins.carry the address and
when ALE-0, theyS6-S3. When ALE =.
(positive or
to
negative) with respect the progTam counter, use the these
oneexternal octal latch
(74373)
values calculated. In addition, in a relocatable
jump address is offset address inthe data segment or the Anta Using whch t Using
canbe de-multiplexed into the
along with thecarryALEthe status lines.
extstertaure, the dta
address bus
A19-Aby16)theandsi8086
gnalthe, these
pins
(S6-S3). S3 and S4
referredto usingthe indicate theinsegment (accessed
13.4 PIN DETAILS
OF8086
following two:
segmet. bus
the
currentt bus cycle. This is shown
Table 13.2
Table 13.2.
up ly nfsotrructin
from the
GND connection
isthe return for the power Memory read
(xii) GND: The
GNDpins and both
must be
connected sground 1
Memory write
SO86 has two
operation.
Mode
used in Minimum followe.
to
(d.Thepropga 1
1
Passive (inactíve)
( )LOCK:The Lock output is usedIto lock peripherals off the system. This pin
134.2FunctionofPins minimum mode are as isactivated by usingthe. LOCK prefix on any instruction.
The pins used in the indicates whetherthe 8086 is (i)ROGTOand RQ/GTI: The request/grant pins request DMA during the
() MÍO: This pin performing operation of the 8086. These
l) or VO read/write operation
(MIOmemory Tead
maximum mode
write operation(MMO = areusedIto request and grant a DMA operation. lines are bidirectional
data =0).
indicates that the 8086 is and
(i) WR: The Write signal logic 0, the sending
data bus contains toa iv) QSIand OS0: The queue status bits show the status of the internal
or /O device. When WR is at
the memory or I/0. yalid medatmaoryior instruction queue in the 8086. These pins are
provided for
(i) DTR: The Data Transmit/Receive signal
indicates that
the 8086 numeric coprocessor (8087). Table 13.4 the shows function ofaccess by the
the QSl and
(DTR= 1) or receiving (DT/R = 0) data.
transmitting(D
control the data flow irection in external data bus buffers,This signal datisa usedbus tois OSObits.
Table 13.4 Function of QS1 and QS0 pins
(iv) DEN: The Data Bus Enable signal activates external data bus
data is transferred through the data bus of the 8086, this
When DEN is high, no data flows in the data bus.
signalbuffers.loWhengic,.
is at QSO Function