Anda di halaman 1dari 14

Microprocessor and Interfaces

MicroprocessorandInterfaces
8085addressingmodes

Addressing modes
Addressingmodes
Eachinstructionofacomputerspecifiesanoperation
oncertaindata
Ineachinstruction,programmerhastospecify3
things:
Operationtobeperformed
Addressofsourceofdata
Addressofdestinationofresult
Add
f d ti ti
f
lt

Therearevariouswaysofspecifyingaddressofthe
datatobeoperatedon
Thesedifferentwaysofspecifyingdataarecalledthe
addressingmodes

Common addressing modes


Commonaddressingmodes

Immediateaddressingmode
Immediate
addressing mode
Directaddressingmode
Indirectaddressingmode
di
dd
i
d
Registeraddressingmode
Registerindirectaddressingmode
Implicit addressing mode
Implicitaddressingmode

Immediate Addressing
ImmediateAddressing
SSimplestaddressingmode
p est add ess g ode
Operandisgivenintheinstructionitself
Used to define a constant or set initial values of
Usedtodefineaconstantorsetinitialvaluesof
variables
Nomemoryreferenceotherthaninstruction
y
fetchisrequiredtoobtainoperand
Sizeofthenumberislimitedtothesizeofthe
addressfield,whichformostinstructionsetsis
smallcomparedtowordlength

Immediate addressing example


Immediateaddressingexample
MVIA,05H::Move05Hinaccumulator
MVI A 05 H :: Move 05 H in accumulator
MVIistheoperation
05Histheimmediatedata(source)
05 H is the immediate data (source)
Aisthedestination

Direct Addressing
DirectAddressing
Effectiveaddressoftheoperandisgiveninthe
ect e add ess o t e ope a d s g e
t e
addressfieldoftheinstruction
q
y
Requiresonememoryreferencetoreadthe
operandfromthegivenlocation
Providesonlyalimitedaddressspace
Lengthoftheaddressfieldisusuallylessthanthe
wordlength

Direct addressing example


Directaddressingexample
LDA
LDA2500H::Loadthecontentsofmemory
2500 H :: Load the contents of memory
location2500Hinaccumulator
LDAistheoperation
LDA is the operation
2500Histheaddressofsource
Accumulatoristhedestination
Accumulator is the destination

Indirect Addressing
IndirectAddressing
Theaddressfieldoftheinstructionreferstothe
e add ess e d o t e st uct o e e s to t e
addressofawordinmemory,whichinturn
containsthefulllengthaddressoftheoperand
Advantage ForthewordlengthofN,anaddress
spaceof2Ncanbeaddressed
Disadvantage Instructionexecutionrequirestwo
memoryreferencetofetchtheoperand
Multilevelorcascadedindirectaddressingcan
M ltil l
d d i di t dd
i
alsobeused

Register Addressing
RegisterAddressing
Similar
Similartodirectaddressing
to direct addressing
Onlydifferenceisthattheaddressfieldofthe
instruction refers to a register rather than a
instructionreferstoaregisterratherthana
memorylocation
3or4bitsareusedasaddressfieldto
3 or 4 bits are used as address field to
reference8to16generalpurposeregisters
Advantage::Smalladdressfieldisneededin
Advantage :: Small address field is needed in
theinstruction

Register addressing example


Registeraddressingexample
MOV
MOVA,B::MovethecontentsofregisterBto
A B :: Move the contents of register B to
A
MOVistheoperation
MOV is the operation
Bisthesourceofdata
Aisthedestination
A is the destination

Register Indirect Addressing


RegisterIndirectAddressing
SSimilartoindirectaddressing
a to d ect add ess g
Theaddressfieldoftheinstructionreferstoa
g
register
Theregistercontainstheeffectiveaddressofthe
operand
Usesonememoryreferencetoobtainthe
operand
Theaddressspaceislimitedtothewidthofthe
registersavailabletostoretheeffectiveaddress

Register indirect addressing example


Registerindirectaddressingexample
MOV
MOVA,M::Movedatafrommemorylocation
A M :: Move data from memory location
specifiedbyHLpairtoaccumulator
MOVistheoperation
MOV is the operation
MisthememorylocationspecifiedbyHLregister
pair
Aisthedestination

Implicit Addressing
ImplicitAddressing
Address
Addressofsourceofdataaswellasaddressof
of source of data as well as address of
destinationofresultisfixed
Thereisnoneedtogiveanyoperandalong
There is no need to give any operand along
withtheinstruction

Implicit addressing example


Implicitaddressingexample
CMA::Complementaccumulator
CMA :: Complement accumulator
CMAistheoperation
Aisthesource
A is the source
Aisthedestination

Anda mungkin juga menyukai