Rev. 1.71 20 April 11, 2017 Rev. 1.71 21 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
Stack
ThisisaspecialpartofthememorywhichisusedtosavethecontentsoftheProgramCounter
only.Thestackisneitherpartofthedatanorpartoftheprogramspace,andisneitherreadablenor
writeable.TheactivatedlevelisindexedbytheStackPointer,andisneitherreadablenorwriteable.
Atasubroutinecallorinterruptacknowledgesignal,thecontentsoftheProgramCounterarepushed
ontothestack.Attheendofasubroutineoraninterruptroutine,signaledbyareturninstruction,
RETorRETI,theProgramCounterisrestoredtoitspreviousvaluefromthestack.Afteradevice
reset,theStackPointerwillpointtothetopofthestack.
Ifthestackisfullandanenabledinterrupttakesplace,theinterruptrequestagwillberecorded
buttheacknowledgesignalwillbeinhibited.WhentheStackPointerisdecremented,byRETor
RETI,theinterruptwillbeserviced.Thisfeaturepreventsstackoverowallowingtheprogrammer
tousethestructuremoreeasily.However,whenthestackisfull,aCALLsubroutineinstructioncan
stillbeexecutedwhichwillresultinastackoverow.Precautionsshouldbetakentoavoidsuch
caseswhichmightcauseunpredictableprogrambranching.Ifthestackisoverow,therstProgram
Countersaveinthestackwillbelost.
Progra m Counte r
Stack Level 1
Stack Level N
Progra m
Memory
T op o f S ta ck
Stack
Poin te r
Bottom o f Stack
Device Stack Levels
HT66F002/HT66F003 2
HT66F0025/HT66F004 4
Arithmetic and Logic Unit – ALU
Thearithmetic-logicunitorALUisacriticalareaofthemicrocontrollerthatcarriesoutarithmetic
andlogicoperationsoftheinstructionset.Connectedtothemainmicrocontrollerdatabus,theALU
receivesrelatedinstructioncodesandperformstherequiredarithmeticorlogicaloperationsafter
whichtheresultwillbeplacedinthespeciedregister.AstheseALUcalculationoroperationsmay
resultincarry,borroworotherstatuschanges,thestatusregisterwillbecorrespondinglyupdatedto
reectthesechanges.TheALUsupportsthefollowingfunctions:
• Arithmeticoperations:ADD,ADDM,ADC,ADCM,SUB,SUBM,SBC,SBCM,DAA
• Logicoperations:AND,OR,XOR,ANDM,ORM,XORM,CPL,CPLA
• Rotation:RRA,RR,RRCA,RRC,RLA,RL,RLCA,RLC
• IncrementandDecrement:INCA,INC,DECA,DEC
• Branchdecision:JMP,SZ,SZA,SNZ,SIZ,SDZ,SIZA,SDZA,CALL,RET,RETI