HT45F12
8-Bit Flash MCU with Op Amps & Comparators
Status Register – STATUS
Thisꢀ8-bitꢀregisterꢀcontainsꢀtheꢀzeroꢀflagꢀ(Z),ꢀcarryꢀflagꢀ(C),ꢀauxiliaryꢀcarryꢀflagꢀ(AC),ꢀoverflowꢀflagꢀ
(OV),ꢀpowerꢀdownꢀflagꢀ(PDF),ꢀandꢀwatchdogꢀtime-outꢀflagꢀ(TO).ꢀTheseꢀarithmetic/logicalꢀoperationꢀ
andꢀsystemꢀmanagementꢀflagsꢀareꢀusedꢀtoꢀrecordꢀtheꢀstatusꢀandꢀoperationꢀofꢀtheꢀmicrocontroller.ꢀ
WithꢀtheꢀexceptionꢀofꢀtheꢀTOꢀandꢀPDFꢀflags,ꢀbitsꢀinꢀtheꢀstatusꢀregisterꢀcanꢀbeꢀalteredꢀbyꢀinstructionsꢀ
likeꢀmostꢀotherꢀregisters.ꢀAnyꢀdataꢀwrittenꢀintoꢀtheꢀstatusꢀregisterꢀwillꢀnotꢀchangeꢀtheꢀTOꢀorꢀPDFꢀflag.ꢀ
Inꢀaddition,ꢀoperationsꢀrelatedꢀtoꢀtheꢀstatusꢀregisterꢀmayꢀgiveꢀdifferentꢀresultsꢀdueꢀtoꢀtheꢀdifferentꢀ
instructionꢀoperations.ꢀTheꢀTOꢀflagꢀcanꢀbeꢀaffectedꢀonlyꢀbyꢀaꢀsystemꢀpower-up,ꢀaꢀWDTꢀtime-outꢀorꢀ
byꢀexecutingꢀtheꢀ“CLRꢀWDT”ꢀorꢀ“HALT”ꢀinstruction.ꢀTheꢀPDFꢀflagꢀisꢀaffectedꢀonlyꢀbyꢀexecutingꢀ
theꢀ“HALT”ꢀorꢀ“CLRꢀWDT”ꢀinstructionꢀorꢀduringꢀaꢀsystemꢀpower-up.
TheꢀZ,ꢀOV,ꢀACꢀandꢀCꢀflagsꢀgenerallyꢀreflectꢀtheꢀstatusꢀofꢀtheꢀlatestꢀoperations.
•ꢀ Cꢀisꢀsetꢀifꢀanꢀoperationꢀresultsꢀinꢀaꢀcarryꢀduringꢀanꢀadditionꢀoperationꢀorꢀifꢀaꢀborrowꢀdoesꢀnotꢀtakeꢀ
placeꢀduringꢀaꢀsubtractionꢀoperation;ꢀotherwiseꢀCꢀisꢀcleared.ꢀCꢀisꢀalsoꢀaffectedꢀbyꢀaꢀrotateꢀthroughꢀ
carryꢀinstruction.
•ꢀ ACꢀisꢀsetꢀifꢀanꢀoperationꢀresultsꢀinꢀaꢀcarryꢀoutꢀofꢀtheꢀlowꢀnibblesꢀinꢀaddition,ꢀorꢀnoꢀborrowꢀfromꢀ
theꢀhighꢀnibbleꢀintoꢀtheꢀlowꢀnibbleꢀinꢀsubtraction;ꢀotherwiseꢀACꢀisꢀcleared.ꢀ
•ꢀ Zꢀisꢀsetꢀifꢀtheꢀresultꢀofꢀanꢀarithmeticꢀorꢀlogicalꢀoperationꢀisꢀzero;ꢀotherwiseꢀZꢀisꢀcleared.
•ꢀ OVꢀisꢀsetꢀifꢀanꢀoperationꢀresultsꢀinꢀaꢀcarryꢀintoꢀtheꢀhighest-orderꢀbitꢀbutꢀnotꢀaꢀcarryꢀoutꢀofꢀtheꢀ
highest-orderꢀbit,ꢀorꢀviceꢀversa;ꢀotherwiseꢀOVꢀisꢀcleared.ꢀ
•ꢀ PDFꢀisꢀclearedꢀbyꢀaꢀsystemꢀpower-upꢀorꢀexecutingꢀtheꢀ“CLRꢀWDT”ꢀinstruction.ꢀPDFꢀisꢀsetꢀbyꢀ
executingꢀtheꢀ“HALT”ꢀinstruction.
•ꢀ TOꢀisꢀclearedꢀbyꢀaꢀsystemꢀpower-upꢀorꢀexecutingꢀtheꢀ“CLRꢀWDT”ꢀorꢀ“HALT”ꢀinstruction.ꢀTOꢀisꢀ
setꢀbyꢀaꢀWDTꢀtime-out.
Inꢀaddition,ꢀonꢀenteringꢀanꢀinterruptꢀsequenceꢀorꢀexecutingꢀaꢀsubroutineꢀcall,ꢀtheꢀstatusꢀregisterꢀwillꢀ
notꢀbeꢀpushedꢀontoꢀtheꢀstackꢀautomatically.ꢀIfꢀtheꢀcontentsꢀofꢀtheꢀstatusꢀregistersꢀareꢀimportantꢀandꢀifꢀ
theꢀsubroutineꢀcanꢀcorruptꢀtheꢀstatusꢀregister,ꢀprecautionsꢀmustꢀbeꢀtakenꢀtoꢀcorrectlyꢀsaveꢀit.
STATUS Register
Bit
Naꢁe
R/W
7
6
5
TO
R
4
PDF
R
3
OV
R/W
x
2
Z
1
AC
R/W
x
0
—
—
—
—
—
—
C
R/W
x
R/W
x
POR
0
0
"x" unknown
Bitꢀ7ꢀ~ꢀ6ꢀ
Bitꢀ5ꢀ
Unimplemented,ꢀreadꢀasꢀ"0"
TO:ꢀWatchdogꢀTime-Outꢀflagꢀ
ꢀ 0:ꢀAfterꢀpowerꢀupꢀorꢀexecutingꢀtheꢀ"CLRꢀWDT"ꢀorꢀ"HALT"ꢀinstructionꢀ
ꢀ 1:ꢀAꢀwatchdogꢀtime-outꢀoccurred.
Bitꢀ4ꢀ
Bitꢀ3ꢀ
PDF:ꢀPowerꢀdownꢀflagꢀ
ꢀ 0:ꢀAfterꢀpowerꢀupꢀorꢀexecutingꢀtheꢀ"CLRꢀWDT"ꢀinstructionꢀ
ꢀ 1:ꢀByꢀexecutingꢀtheꢀ"HALT"ꢀinstruction
OV:ꢀOverflowꢀflagꢀ
ꢀ 0:ꢀNoꢀoverflowꢀ
ꢀ 1:ꢀAnꢀoperationꢀresultsꢀinꢀaꢀcarryꢀintoꢀtheꢀhighest-orderꢀbitꢀbutꢀnotꢀaꢀcarryꢀoutꢀofꢀtheꢀ
ꢀꢀꢀꢀꢀꢀꢀhighest-orderꢀbitꢀorꢀviceꢀversa.
Bitꢀ2ꢀ
Z:ꢀZeroꢀflagꢀ
ꢀ 0:ꢀTheꢀresultꢀofꢀanꢀarithmeticꢀorꢀlogicalꢀoperationꢀisꢀnotꢀzeroꢀ
ꢀ 1:ꢀTheꢀresultꢀofꢀanꢀarithmeticꢀorꢀlogicalꢀoperationꢀisꢀzero
Rev. 0.00
ꢄ7
�eꢀteꢁꢂeꢃ ꢄꢅꢆ ꢄ01ꢄ