Rev. 1.50 186 August 28, 2017 Rev. 1.50 187 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Instruction Set
Introduction
Centraltothesuccessfuloperationofanymicrocontrollerisitsinstructionset,whichisasetof
programinstructioncodesthatdirectsthemicrocontrollertoperformcertainoperations.Inthecase
ofHoltekmicrocontroller,acomprehensiveandexiblesetofover60instructionsisprovidedto
enableprogrammerstoimplementtheirapplicationwiththeminimumofprogrammingoverheads.
Foreasierunderstandingofthevariousinstructioncodes,theyhavebeensubdividedintoseveral
functionalgroupings.
Instruction Timing
Mostinstructionsareimplementedwithinoneinstructioncycle.Theexceptionstothisarebranch,
call,ortablereadinstructionswheretwoinstructioncyclesarerequired.Oneinstructioncycleis
equalto4systemclockcycles,thereforeinthecaseofan8MHzsystemoscillator,mostinstructions
wouldbeimplementedwithin0.5μsandbranchorcallinstructionswouldbeimplementedwithin
1μs.Althoughinstructionswhichrequireonemorecycletoimplementaregenerallylimitedto
theJMP,CALL,RET,RETIandtablereadinstructions,itisimportanttorealizethatanyother
instructionswhichinvolvemanipulationoftheProgramCounterLowregisterorPCLwillalsotake
onemorecycletoimplement.AsinstructionswhichchangethecontentsofthePCLwillimplya
directjumptothatnewaddress,onemorecyclewillberequired.Examplesofsuchinstructions
wouldbe“CLRPCL”or“MOVPCL,A”.Forthecaseofskipinstructions,itmustbenotedthatif
theresultofthecomparisoninvolvesaskipoperationthenthiswillalsotakeonemorecycle,ifno
skipisinvolvedthenonlyonecycleisrequired.
Moving and Transferring Data
Thetransferofdatawithinthemicrocontrollerprogramisoneofthemostfrequentlyused
operations.MakinguseofseveralkindsofMOVinstructions,datacanbetransferredfromregisters
totheAccumulatorandvice-versaaswellasbeingabletomovespecicimmediatedatadirectly
intotheAccumulator.Oneofthemostimportantdatatransferapplicationsistoreceivedatafrom
theinputportsandtransferdatatotheoutputports.
Arithmetic Operations
Theabilitytoperformcertainarithmeticoperationsanddatamanipulationisanecessaryfeatureof
mostmicrocontrollerapplications.WithintheHoltekmicrocontrollerinstructionsetarearangeof
addandsubtractinstructionmnemonicstoenablethenecessaryarithmetictobecarriedout.Care
mustbetakentoensurecorrecthandlingofcarryandborrowdatawhenresultsexceed255for
additionandlessthan0forsubtraction.TheincrementanddecrementinstructionssuchasINC,
INCA,DECandDECAprovideasimplemeansofincreasingordecreasingbyavalueofoneofthe
valuesinthedestinationspecied.