Rev. 2.50 258 June 22, 2017 Rev. 2.50 259 June 22, 2017
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
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.MakinguseofthreekindsofMOVinstructions,datacanbetransferredfromregistersto
theAccumulatorandvice-versaaswellasbeingabletomovespecicimmediatedatadirectlyinto
theAccumulator.Oneofthemostimportantdatatransferapplicationsistoreceivedatafromthe
inputportsandtransferdatatotheoutputports.
Arithmetic Operations
Theabilitytoperformcertainarithmeticoperationsanddatamanipulationisanecessaryfeatureof
mostmicrocontrollerapplications.WithintheHoltekmicrocontrollerinstructionsetarearangeof
addandsubtractinstructionmnemonicstoenablethenecessaryarithmetictobecarriedout.Care
mustbetakentoensurecorrecthandlingofcarryandborrowdatawhenresultsexceed255for
additionandlessthan0forsubtraction.TheincrementanddecrementinstructionsINC,INCA,DEC
andDECAprovideasimplemeansofincreasingordecreasingbyavalueofoneofthevaluesinthe
destinationspecied.