ETIC 2230 Guia do Utilizador Página 17

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 148
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 16
Rev. 1.10 16 November 14, 2014 Rev. 1.10 17 November 14, 2014
HT66FW2230
Wireless Charger A/D Flash 8-Bit MCU
Instruction Fetching
Program Counter
Duringprogramexecution,theProgramCounterisusedtokeeptrackoftheaddressofthe
nextinstructiontobeexecuted.Itisautomaticallyincrementedbyoneeachtimeaninstruction
isexecutedexceptforinstructions,suchas“JMP”or“CALL”thatdemandajumptoanon-
consecutiveProgramMemoryaddress.Onlythelower8bits,knownastheProgramCounterLow
Register,aredirectlyaddressablebytheapplicationprogram.
Whenexecutinginstructionsrequiringjumpstonon-consecutiveaddressessuchasajump
instruction,asubroutinecall,interruptorreset,etc.,themicrocontrollermanagesprogramcontrol
byloadingtherequiredaddressintotheProgramCounter.Forconditionalskipinstructions,once
theconditionhasbeenmet,thenextinstruction,whichhasalreadybeenfetchedduringthepresent
instructionexecution,isdiscardedandadummycycletakesitsplacewhilethecorrectinstructionis
obtained.
Program Counter
Program Counter High byte PCL Register
PC11~PC8 PCL7~PCL0
ThelowerbyteoftheProgramCounter,knownastheProgramCounterLowregisterorPCL,is
availableforprogramcontrolandisareadableandwriteableregister.Bytransferringdatadirectly
intothisregister,ashortprogramjumpcanbeexecuteddirectly,however,asonlythislowbyte
isavailableformanipulation,thejumpsarelimitedtothepresentpageofmemory,thatis256
locations.Whensuchprogramjumpsareexecuteditshouldalsobenotedthatadummycycle
willbeinserted.ManipulatingthePCLregistermaycauseprogrambranching,soanextracycleis
neededtopre-fetch.
Stack
ThisisaspecialpartofthememorywhichisusedtosavethecontentsoftheProgramCounter
only.Thestackisneitherpartofthedatanorpartoftheprogramspace,andisneitherreadablenor
writeable.TheactivatedlevelisindexedbytheStackPointer,andisneitherreadablenorwriteable.
Atasubroutinecallorinterruptacknowledgesignal,thecontentsoftheProgramCounterarepushed
ontothestack.Attheendofasubroutineoraninterruptroutine,signaledbyareturninstruction,
RETorRETI,theProgramCounterisrestoredtoitspreviousvaluefromthestack.Afteradevice
reset,theStackPointerwillpointtothetopofthestack.
Ifthestackisfullandanenabledinterrupttakesplace,theinterruptrequestagwillberecorded
buttheacknowledgesignalwillbeinhibited.WhentheStackPointerisdecremented,byRETor
RETI,theinterruptwillbeserviced.Thisfeaturepreventsstackoverowallowingtheprogrammer
tousethestructuremoreeasily.However,whenthestackisfull,aCALLsubroutineinstructioncan
stillbeexecutedwhichwillresultinastackoverow.Precautionsshouldbetakentoavoidsuch
caseswhichmightcauseunpredictableprogrambranching.Ifthestackisoverow,therstProgram
Countersaveinthestackwillbelost.
Vista de página 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 ... 147 148

Comentários a estes Manuais

Sem comentários