Module - 2
Module - 2
✗
Family ☆ the contents of the code segment ④ Instruction
pointer registers a re
generally summed
up
The 16 bit Processors in order to of the
get the address instruction
-
80-86 8028£
-
8086 Buses
Address lines Address Hines
-
20
•
24
"
"
•
2 -
I MB •
z
- 16 MA
Ao
•
2.5 MIPS ◦ 4 MIPS
( million ist perky Aig bus
(I n intel family ,
size of
resist reflect size of up ) Do
bit processors
]
→ MEMR
80486 control MEMW
80381
-
-
signals
¥8T
-
" "
2 4GB 2 -
4GB
built
• -
.
( Hasani
-
floating Pt unit
unit Edi
"
•
coprocessor)
•
50 MIPS had
poor
•
outside
Alq - - - - - -
Ao
0 O -
✗ 86 00000h
of family
- - - - -
Characterists the
↓
1 I - FFF Ff
CISC n
- - - - -
-
Instructions -
broken up into
Mops (Micro operations )
#
0000h
-
8086 -
Programmer's Model
memos
Adam
space
} →
i.
:
pffffn
|
Architecture of 8086 resist
an
" ☆ Fetches Instruction - BIV
L %÷
☆ Executes Instruction Eu
part
→
regions ~
BIU
of
men
Code
*Ñ addrefat.tn
segment
get
segmwe.fm
g g
bits
part
resisters ushers
EU
of terror
of
on
register gouge
to
kind of result obtained
indicating
ALU
f) n o m
I
☆ It has program
8088
Variation of 8086 ( )
-
set of instructions
most 1=10 devices
Code Segment
☆ External Data Bus -
8 bits [ Because *
-
⑨ ⁿʰ% W"
☆ Data available in
☆ Instruction Queue 4 bytes
organised ]
-
Data segment it
-
8086 -
☆kki
stack Segment
☆ fetches Instruction → B IU operations in subroutines
☆ Executes Instruction → Eu
☆ FS ② GS are multipurpose
Memory Addressing ☆ It
may be
possible that
only CS and DS
② Protected
☆ There can also be segments with some set
wewillbelookiyatrealmodefamow.ge only
IP with CS
* ☆ combines .
Programmer's Model -
BIV E CS = 2000
µ Base address Csegmatadderss
IP address
p◦iM→i 3000h Offset
=
IP
Extended 16
bit
wo n EIP Mn IP → Another
register ʰ°°°#"ˢ°°°→ CS
Fit
,,,µµ,,µ µ
Cs Code segment
]
of them
-
a re
sent (all #
ret
DS
16 bit
-
Data -
Es -
Extra -
resists ] SS
,
SS -
stack _
MM f- S MM -
F segment
am as mm -
a segment while you code
segment is going to start
wrt Stan
Wwe this particular instruction is present adams
( 0000N )
=
20000h +
☆ CS ② IP combined to make 20 bit
address
of intel
.
We do this because
to be
memory
segmented
z}%°÷→ Instruction
location
from this
processors a re
going .
memory is fetched
by BIU
CS IP Zoff
E① 2100
: :
Zoff F
=) 21000 1- =
23 of
② : 5200 IP zfff
(S
:
=) 52000 +
ZFFF = SYFFF
58Fffn
③ f- Fff IP : 0000 ,
(S :
Extra
FO FFFFO €5
f- f- f-
=
+0000
yq ◦ ◦ on
←
pygmy
☆ When reset @ start MP CS 43ffFn
you your by
Stack
,
value ffff
default will hone
swoon -3000 SS
oz z y
☆ first address generated by Mp . Instruction at zffffn
by Code
f- FFFO is first instruction executed any < ◦ ◦ ◦
on
←2 Cs
Intel lffffn
member
of Up Data
← ⑤ DS
10000h
2000 → ← ⑤ ggg
Base valve
00000h
at
points ">
do c-
( Wwe it is going
begin
sort gg present wit
wwete is
works
only in
( segment 216
µÑ FF⑤ Every segment size of
bits
☆ can have maximum
c-
=
64 KB
Advantages of segmentation
☆ Relocation High Memory
→ we
specify only offset ☆ When 05 loads
,
NIMEM.SN is also loaded
have at location
for example
→
,
we a
program ☆ It enables on e m o re address line in Real mode : Azo
f- 0000h .
FF
☆
f Segment Address -
FF n
foooon another
Different
at at
→ segment Mp .
Offset Address
-
4000h
for another Up might
be
CS
10000h
→ since we have offsets ,
we can use some
_
103 Ffon ( IMB )
Ffon ( IMB ) ( If
program ( same offset )
03 NIMEM - Sts is not
loaded )
resisters
needs to change from f- 000ns
→ Only segment,
1000N
Programmer's Model -
F- U ( 16 -
bit Mp )
÷:*
}
Example Segment Addresses
Base Index (@ resists
Starting Ending Count
Segment
Adam Address Data 16 bits
register
]
"
20000h 2 FF FF
2000h n
DI
-
!
Source Index
na ,
Registers
3 Off f- n
21 ◦
◦
On
2100m
Generally stores an
operand duris
A- ②L
stores )
Operation ( Not
always
1234h 12340h 2233 Fn
☆ Base Index -
you
want to do data transfer
Base value
TIE
-
Used in loops ⑨ strings / of bytes) Default 16 bit segment and offset address combinations
☆ Stack Pointer -
☆ Base Pointer
-
Cs Ip Instruction
Address
data
② Also used to hold
number
an 8-bit directly give
⑧ Destination either DS @ f- 5 16 -
bit number
offset )
F- S DI for string string destination
Instructions address
F- FLAGS FLAGS
/\
Multipurpose Registers status control
flees flag
AX BX CX , DX BP DI SI ( storing operands for
controlling
, , , ,
FLAGS
SP
( IP Flog register
Instruction
IP
, , only for programmer 's Model : Eu -
and not
SS f- S
Point for CS
CS , DS
, ,
any
other purpose )
( Segment Registers ) to add IP
( can't say Flags : Two
types
with BX )
Coutts
kind of
☆
Status : indicates the result we obtain
as a result of A ② L operation .
16 bit Perish
AX An AL AY ☆ o : used
for controlling certain operations
bit ) ( 8 bit) be broken
of
can
meany the
bit
Mp .
into 2 8
Bn BL
BX registers
flag Register
( Bae Resist)
*
111111 11111¥47 171*144*44 # Hk
ex en et
sp.BP.SI/Di-
( Used as
a county cannot be broken
up into 8 bit
DX Dn DL Ba -
Available 8086 onwards
[ Used to
• Available 80286 Onwards
date
-
to
point 80386 onwards
i n -40 operations) § -
Available
B- Available 80486
's MPR
Programmer
-
others . -
Control flags
so
A- ✗ becomes EA× and on
not used
☆ the ones with no bit indication are _
in Real
EAX An Al ( Een a 32
we a re not
supposed to change these bits @ ac tors
mode ,
F- BX BN BL
can
perform them .
operations)
bit 8086
F- ( ✗ Ch
ch
status flags after :
F- DX Dh DL g, g ;+
doing Arithmetic operation
①
can
flag
when you
F- BP BP Carry : ,
addition
f- SI SI
get carry a .
F- SP SP is 1 else °
If carry bit .
borrow
reset
,
⑨
.
the Is the control flags after 8086 :
② Parity Flag : It
gives no .
of present in
result .
If no .
of 1s is e ve n
, parity is
① trap flag
:
It'll cause the
processor to have after
parity ) for
be used
( Else It
set for odd instruction can
I @ eve n .
, every .
after every .
to enable
③ Auxiliary carry ! It is similar to
Carry flag .
② Interrupt flag :
It is used
@
I t indicates interrupt If set interrupts
-
call subprograms
E Ofn
.
to In =
Ion
set (1)
.
of data .
( only makes sense in 8 bit
operations ) It stops up
whatever it is doing currently
☆
address called
and branching to different
will its in BCD operations address )
"
use
we see
n
④ Zero flag :
If result is
zero , flag is set (1) .
:
Direction
A ⑧ cops)
Else , red (D) .
( used win
reflects Do
⑤ Sign flag :
It the MSB of data ¥ In Dis can
parse this string from firsttolast_
-
you
- -
-
is MSB
Condition of Dis is condition of ig-bby.RS .
orvicerersa .
1
E: 8000 ( Afth A operation ) Dis bit is ☆ Direction blog determines direction of parsing .
µ
,
,
7 Fffin ( -7 D bit is °
'
, later
①
,
positive _
⑧ in
protected mode of operation .
indicate 's
⑥ whether
used to 2
Overflow flag : It is
occurred
④ Resume :
It is used with
debugging operations .
Complement overflow
has .
¥
address @ whether it should be reseated
¥ ¥ ( b/c NSB is 1 in
and started all over is indicated by it
result ) again .
1 's arithmetic
Cannot be supported in complement will from whatever
.
☆ If Sef ,
it resume
address the
processor stopped after debugging .
① Virtual Mode :
If set ,
80386 behaves exactly as
of operation
bounding is maimed by the
Mp
.
whence
tenses net
it is storing
.
boundary is maintained
If It ,
tnen .
80×86 Summary
-
Unit )
f- U ( Execution
too )