Rev. 1.50 26 August 28, 2017 Rev. 1.50 27 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Stack
ThisisaspecialpartofthememorywhichisusedtosavethecontentsoftheProgramCounter
only.Thestackhasmultiplelevelsandisneitherpartofthedatanorpartoftheprogramspace,
andisneitherreadablenorwriteable.TheactivatedlevelisindexedbytheStackPointer,andis
neitherreadablenorwriteable.Atasubroutinecallorinterruptacknowledgesignal,thecontentsof
theProgramCounterarepushedontothestack.Attheendofasubroutineoraninterruptroutine,
signaledbyareturninstruction,RETorRETI,theProgramCounterisrestoredtoitspreviousvalue
fromthestack.Afteradevicereset,theStackPointerwillpointtothetopofthestack.
Ifthestackisfullandanenabledinterrupttakesplace,theinterruptrequestagwillberecordedbut
theacknowledgesignalwillbeinhibited.WhentheStackPointerisdecremented,byRETorRETI,
theinterruptwillbeserviced.Thisfeaturepreventsstackoverowallowingtheprogrammertouse
thestructuremoreeasily.However,whenthestackisfull,aCALLsubroutineinstructioncanstill
beexecutedwhichwillresultinastackoverow.Precautionsshouldbetakentoavoidsuchcases
whichmightcauseunpredictableprogrambranching.
Ifthestackisoverow,therstProgramCountersaveinthestackwillbelost.
Stack
Pointer
Stack Level 2
Stack Level 1
Stack Level 3
:
:
:
Stack Level 8
Program Memory
Program Counter
Bottom of Stack
Top of Stack
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