Rev. 1.71 30 April 11, 2017 Rev. 1.71 31 April 11, 2017
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
Status Register – STATUS
This8-bitregistercontainsthezeroag(Z),carryag(C),auxiliarycarryag(AC),overowag
(OV),powerdownag(PDF),andwatchdogtime-outag(TO).Thesearithmetic/logicaloperation
andsystemmanagementagsareusedtorecordthestatusandoperationofthemicrocontroller.
WiththeexceptionoftheTOandPDFags,bitsinthestatusregistercanbealteredbyinstructions
likemostotherregisters.AnydatawrittenintothestatusregisterwillnotchangetheTOorPDFag.
Inaddition,operationsrelatedtothestatusregistermaygivedifferentresultsduetothedifferent
instructionoperations.TheTOagcanbeaffectedonlybyasystempower-up,aWDTtime-outor
byexecutingthe“CLRWDT”or“HALT”instruction.ThePDFagisaffectedonlybyexecuting
the“HALT”or“CLRWDT”instructionorduringasystempower-up.
TheZ,OV,ACandCagsgenerallyreectthestatusofthelatestoperations.
• Cissetifanoperationresultsinacarryduringanadditionoperationorifaborrowdoesnottake
placeduringasubtractionoperation;otherwiseCiscleared.Cisalsoaffectedbyarotatethrough
carryinstruction.
• ACissetifanoperationresultsinacarryoutofthelownibblesinaddition,ornoborrowfrom
thehighnibbleintothelownibbleinsubtraction;otherwiseACiscleared.
• Zissetiftheresultofanarithmeticorlogicaloperationiszero;otherwiseZiscleared.
• OVissetifanoperationresultsinacarryintothehighest-orderbitbutnotacarryoutofthe
highest-orderbit,orviceversa;otherwiseOViscleared.
• PDFisclearedbyasystempower-uporexecutingthe“CLRWDT”instruction.PDFissetby
executingthe“HALT”instruction.
• TOisclearedbyasystempower-uporexecutingthe“CLRWDT”or“HALT”instruction.TOis
setbyaWDTtime-out.
Inaddition,onenteringaninterruptsequenceorexecutingasubroutinecall,thestatusregisterwill
notbepushedontothestackautomatically.Ifthecontentsofthestatusregistersareimportantandif
thesubroutinecancorruptthestatusregister,precautionsmustbetakentocorrectlysaveit.