Documente Academic
Documente Profesional
Documente Cultură
ProgramsFor8085MicroprocessorLearners
Togglenavigation
Scanftree.com
DataStructure
OperatingSystem
C
GraphTheory
Microprocessor
DBMS
DatabaseConcept
SQL
SQLite
Examples
C
JAVA
C++
Extra
CheatSheets
SEO
IFSCCodes
Microprocessor
1. Advantages&Disadvantages
2. ApplicationsofMicroprocessors
3. EvolutionandClassification
Microprocessor8085
1.
2.
3.
4.
5.
6.
7.
8.
Architechture
Pindescription
AddressingModes
BusStructure
Interrupts
InstructionSet
ProgramsLevel1
ProgramsLevel2
Microprocessor8086
1. Architechture
2. Pindescription
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
1/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
DMA8237
1. Introduction
2. BlockDiagram
3. Pindescription
Advertisment
Alstom'sInternetusage
policyrestrictsaccesstothiswebsite.
729
Like
Share
Store8bitdatainmemory
Program1:
MVIA,52H:"Store32Hintheaccumulator"
STA4000H:"Copyaccumulatorcontentsataddress4000H"
HLT:"Terminateprogramexecution"
Program2:
LXIH:"LoadHLwith4000H"
MVIM:"Store32HinmemorylocationpointedbyHLregisterpair(4000H)"
HLT:"Terminateprogramexecution"
Note:Theresultofbothprogramswillbethesame.Inprogram1directaddressinginstructionisused,whereas
inprogram2indirectaddressinginstructionisused.
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
2/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
Exchangethecontentsofmemorylocations
Statement:Exchangethecontentsofmemorylocations2000Hand4000H.
Program1:
LDA2000H:"Getthecontentsofmemorylocation2000Hintoaccumulator"
MOVB,A:"SavethecontentsintoBregister"
LDA4000H:"Getthecontentsofmemorylocation4000Hintoaccumulator"
STA2000H:"Storethecontentsofaccumulatorataddress2000H"
MOVA,B:"GetthesavedcontentsbackintoAregister"
STA4000H:"Storethecontentsofaccumulatorataddress4000H"
Program2:
LXIH2000H:"InitializeHLregisterpairasapointertomemorylocation2000H."
LXID4000H:"InitializeDEregisterpairasapointertomemorylocation4000H."
MOVB,M:"Getthecontentsofmemorylocation2000HintoBregister."
LDAXD:"Getthecontentsofmemorylocation4000HintoAregister."
MOVM,A:"StorethecontentsofAregisterintomemorylocation2000H."
MOVA,B:"CopythecontentsofBregisterintoaccumulator."
STAXD:"StorethecontentsofAregisterintomemorylocation4000H."
HLT:"Terminateprogramexecution."
Note:InProgram1,directaddressinginstructionsareused,whereasinProgram2,indirectaddressing
instructionsareused.
Addtwo8bitnumbers
Statement:Addthecontentsofmemorylocations4000Hand4001Handplacetheresultinmemorylocation
4002H.
Sampleproblem
(4000H)=14H
(4001H)=89H
Result=14H+89H=9DH
Sourceprogram
LXIH4000H:"HLpoints4000H"
MOVA,M:"Getfirstoperand"
INXH:"HLpoints4001H"
ADDM:"Addsecondoperand"
INXH:"HLpoints4002H"
MOVM,A:"Storeresultat4002H"
HLT:"Terminateprogramexecution"
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
3/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
Subtracttwo8bitnumbers
Statement:Subtractthecontentsofmemorylocation4001Hfromthememorylocation2000Handplacethe
resultinmemorylocation4002H.
Program:Subtracttwo8bitnumbers
Sampleproblem:
(4000H)=51H
(4001H)=19H
Result=51H19H=38H
Sourceprogram:
LXIH,4000H:"HLpoints4000H"
MOVA,M:"Getfirstoperand"
INXH:"HLpoints4001H"
SUBM:"Subtractsecondoperand"
INXH:"HLpoints4002H"
MOVM,A:"Storeresultat4002H"
HLT:"Terminateprogramexecution"
Addtwo16bitnumbers
Statement:Addthe16bitnumberinmemorylocations4000Hand4001Htothe16bitnumberinmemory
locations4002Hand4003H.Themostsignificanteightbitsofthetwonumberstobeaddedareinmemory
locations4001Hand4003H.Storetheresultinmemorylocations4004Hand4005Hwiththemostsignificant
byteinmemorylocation4005H.
Sampleproblem:
(4000H)=15H
(4001H)=1CH
(4002H)=B7H
(4003H)=5AH
Result=1C15+5AB7H=76CCH
(4004H)=CCH
(4005H)=76H
SourceProgram1:
LHLD4000H:"GetfirstI6bitnumberinHL"
XCHG:"SavefirstI6bitnumberinDE"
LHLD4002H:"GetsecondI6bitnumberinHL"
MOVA,E:"Getlowerbyteofthefirstnumber"
ADDL:"Addlowerbyteofthesecondnumber"
MOVL,A:"StoreresultinLregister"
MOVA,D:"Gethigherbyteofthefirstnumber"
ADCH:"AddhigherbyteofthesecondnumberwithCARRY"
MOVH,A:"StoreresultinHregister"
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
4/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
SHLD4004H:"StoreI6bitresultinmemorylocations4004Hand4005H"
HLT:"Terminateprogramexecution"
Sourceprogram2:
LHLD4000H:GetfirstI6bitnumber
XCHG:SavefirstI6bitnumberinDE
LHLD4002H:GetsecondI6bitnumberinHL
DADD:AddDEandHL
SHLD4004H:StoreI6bitresultinmemorylocations4004Hand4005H.
HLT:Terminateprogramexecution
NOTE:Inprogram1,eightbitadditioninstructionsareused(ADDandADC)andadditionisperformedintwo
steps.FirstlowerbyteadditionusingADDinstructionandthenhigherbyteadditionusingADCinstruction.In
program2,16bitadditioninstruction(DAD)isused.
Addcontentsoftwomemorylocations
Statement:Addthecontentsofmemorylocations40001Hand4001Handplacetheresultinthememory
locations4002Hand4003H.
Sampleproblem:
(4000H)=7FH
(400lH)=89H
Result=7FH+89H=lO8H
(4002H)=08H
(4003H)=0lH
Sourceprogram:
LXIH,4000H:"HLPoints4000H"
MOVA,M:"Getfirstoperand"
INXH:"HLPoints4001H"
ADDM:"Addsecondoperand"
INXH:"HLPoints4002H"
MOVM,A:"Storethelowerbyteofresultat4002H"
MVIA,00:"Initializehigherbyteresultwith00H"
ADCA:"Addcarryinthehighbyteresult"
INXH:"HLPoints4003H"
MOVM,A:"Storethehigherbyteofresultat4003H"
HLT:"Terminateprogramexecution"
Subtracttwo16bitnumbers
Statement:Subtractthe16bitnumberinmemorylocations4002Hand4003Hfromthe16bitnumberin
memorylocations4000Hand4001H.Themostsignificanteightbitsofthetwonumbersareinmemory
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
5/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
locations4001Hand4003H.Storetheresultinmemorylocations4004Hand4005Hwiththemostsignificant
byteinmemorylocation4005H.
Sampleproblem:
(4000H)=19H
(400IH)=6AH
(4004H)=I5H(4003H)=5CH
Result=6A19H5C15H=OE04H
(4004H)=04H
(4005H)=OEH
Sourceprogram:
LHLD4000H:"Getfirst16bitnumberinHL"
XCHG:"Savefirst16bitnumberinDE"
LHLD4002H:"Getsecond16bitnumberinHL"
MOVA,E:"Getlowerbyteofthefirstnumber"
SUBL:"Subtractlowerbyteofthesecondnumber"
MOVL,A:"StoretheresultinLregister"
MOVA,D:"Gethigherbyteofthefirstnumber"
SBBH:"Subtracthigherbyteofsecondnumberwithborrow"
MOVH,A:"Storel6bitresultinmemorylocations4004Hand4005H"
SHLD4004H:"Storel6bitresultinmemorylocations4004Hand4005H"
HLT:"Terminateprogramexecution"
Findingonescomplementofanumber
Statement:Findthelscomplementofthenumberstoredatmemorylocation4400Handstorethe
complementednumberatmemorylocation4300H.
Sampleproblem:
(4400H)=55H
Result=(4300B)=AAB
Sourceprogram:
LDA4400B:"Getthenumber"
CMA:"Complementnumber"
STA4300H:"Storetheresult"
HLT:"Terminateprogramexecution"
FindingTwoscomplementofanumber
Statement:Findthe2scomplementofthenumberstoredatmemorylocation4200Handstorethe
complementednumberatmemorylocation4300H
Sampleproblem:
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
6/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
(4200H)=55H
Result=(4300H)=AAH+1=ABH
Sourceprogram:
LDA4200H:"Getthenumber"
CMA:"Complementthenumber"
ADI,01H:"Addoneinthenumber"
STA4300H:"Storetheresult"
HLT:"Terminateprogramexecution"
PacktheunpackedBCDnumbers
Statement:PackthetwounpackedBCDnumbersstoredinmemorylocations4200Hand4201Handstoreresult
inmemorylocation4300H.Assumetheleastsignificantdigitisstoredat4200H.
Sampleproblem:
(4200H)=04
(4201H)=09
Result=(4300H)=94
Sourceprogram:
LDA4201H:"GettheMostsignificantBCDdigit"
RLC
RLC
RLC
RLC:"Adjustthepositionoftheseconddigit(09ischangedto90)"
ANIFOH:"MakeleastsignificantBCDdigitzero"
MOVC,A:"storethepartialresult"
LDA4200H:"GetthelowerBCDdigit"
ADDC:"AddlowerBCDdigit"
STA4300H:"Storetheresult"
HLT:"Terminateprogramexecution"
UnpackaBCDnumber
Statement:TwodigitBCDnumberisstoredinmemorylocation4200H.UnpacktheBCDnumberandstorethe
twodigitsinmemorylocations4300Hand4301Hsuchthatmemorylocation4300HwillhavelowerBCDdigit.
Sampleproblem:
(4200H)=58
Result=(4300H)=08and
(4301H)=05
Sourceprogram:
LDA4200H:"GetthepackedBCDnumber"
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
7/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
ANIFOH:"Masklowernibble"
RRC
RRC
RRC
RRC:"AdjusthigherBCDdigitasalowerdigit"
STA4301H:"Storethepartialresult"
LDA4200H:"GettheoriginalBCDnumber"
ANIOFH:"Maskhighernibble"
STA4201H:"Storetheresult"
HLT:"Terminateprogramexecution"
Executionformatofinstructions
Statement:Readtheprogramgivenbelowandstatethecontentsofallregistersaftertheexecutionofeach
instructioninsequence.
Mainprogram:
4000HLXISP,27FFH
4003HLXIH,2000H
4006HLXIB,1020H
4009HCALLSUB
400CHHLT
Subroutineprogram:
4100HSUB:PUSHB
4101HPUSHH
4102HLXIB,4080H
4105HLXIH,4090H
4108HSHLD2200H
4109HDADB
410CHPOPH
410DHPOPB
410EHRET
Rightshift,bitofdata(8bitand16bit)
Statement:Writeaprogramtoshiftaneightbitdatafourbitsright.AssumedataisinregisterC.
Sampleproblem:
(4200H)=58
Result=(4300H)=08and
(4301H)=05
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
8/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
Sourceprogram1:
MOVA,C
RAR
RAR
RAR
RAR
MOVC,A
HLT
Statement:Writeaprogramtoshifta16bitdata,1bitright.AssumethatdataisinBCregisterpair.
Sourceprogram2
MOVA,B
RAR
MOVB,A
MOVA,C
RAR
MOVC,A
HLT
LeftShiftingofa16bitdata
Statement:Programtoshifta16bitdata1bitleft.AssumedataisintheHLregister
HL=1025=0001000000100101
HL=0001000000100101
+HL=0001000000100101
Result=0010000001001010
Alterthecontentsofflagregisterin8085
Statement:Writeasetofinstructionstoalterthecontentsofflagregisterin8085.
PUSHPSW:"Saveflagsonstack"
POPH:"RetrieveflagsinL"
MOVA,L:"Flagsinaccumulator"
CMA:"Complementaccumulator"
MOVL,A:"AccumulatorinL"
PUSHH:"Saveonstack"
POPPSW:"Backtoflagregister"
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
9/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
HLT:"Terminateprogramexecution"
Tweet
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
Like
10/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
WHAT'STHIS?
AROUNDTHEWEB
Lifegooroo
Web2Carz.com
SimpleEyeExerciseCanCureAll
VisionProblems
PlaneHitsBridge,ManSkisBehind
Car,SnakePulledFromCar
RestoreMyVision
AnEasy&ProvenMethodTo
NaturallyGetYourVisionBack
Universities.AC
OMG.BestCollegeintheWorld!
ALSOONSCANFTREE.COM
AddressingModesin80852comments
PROGRAMSFOR8085MICROPROCESSOR
LEARNERS1comment
CProgramtoreadnameandmarksofstudents
andstoreitinfile2comments
Architechtureof80851comment
0Comments
Recommend
Scanftree.com
Share
Login
SortbyNewest
Startthediscussion
Scanftreeisoptimizedforlearning,testing,andtraining.Examplesmightbesimplifiedtoimprovereadingand
basicunderstanding.Tutorials,references,andexamplesareconstantlyreviewedtoavoiderrors,butwecannot
warrantfullcorrectnessofallcontent.Whileusingthissite,youagreetohavereadandacceptedourtermsofuse
andprivacypolicy.
Copyright2014Scanftree.
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
11/12
5/12/2015
ProgramsFor8085MicroprocessorLearners
http://scanftree.com/microprocessor/ProgramsFor8085MicroprocessorLearners
12/12