
Rev. 1.21 20 November 09, 2017 Rev. 1.21 21 November 09, 2017
HT66F488/HT66F489
A/D Flash MCU with EEPROM
HT66F488/HT66F489
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 2
Stack Level 3
Stack Level 8
Progra m
Memory
Top of S ta ck
Stack
Poin te r
Bottom o f 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,LADD,
LADDM,LADC,LADCM,LSUB,LSUBM,LSBC,LSBCM,LDAA
• Logicoperations:AND,OR,XOR,ANDM,ORM,XORM,CPL,CPLA,LAND,LANDM,
LOR,LORM,LXOR,LXORM,LCPL,LCPLA
• Rotation:RRA,RR,RRCA,RRC,RLA,RL,RLCA,RLC,LRR,LRRA,LRRCA,LRRC,
LRLA,LRLCA,LRLC
• IncrementandDecrement:INCA,INC,DECA,DEC,LINCA,LINC,LDECA,LDEC
• Branchdecision:JMP,SZ,SZA,SNZ,SIZ,SDZ,SIZA,SDZA,CALL,RET,RETI,LSNZ,LSZ,
LSZA,LSIZ,LSDZ,LSIZA,LSDZA