Rev. 1.20 26 January 23, 2015 Rev. 1.20 27 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
Instruction Fetching
Program Counter
Duringprogramexecution,theProgramCounterisusedtokeeptrackoftheaddressofthe
nextinstructiontobeexecuted.Itisautomaticallyincrementedbyoneeachtimeaninstruction
isexecutedexceptforinstructions,suchas"JMP"or"CALL"thatdemandajumptoanon-
consecutiveProgramMemoryaddress.Onlythelower8bits,knownastheProgramCounterLow
Register,aredirectlyaddressablebytheapplicationprogram.
Whenexecutinginstructionsrequiringjumpstonon-consecutiveaddressessuchasajump
instruction,asubroutinecall,interruptorreset,etc.,themicrocontrollermanagesprogramcontrol
byloadingtherequiredaddressintotheProgramCounter.Forconditionalskipinstructions,once
theconditionhasbeenmet,thenextinstruction,whichhasalreadybeenfetchedduringthepresent
instructionexecution,isdiscardedandadummycycletakesitsplacewhilethecorrectinstructionis
obtained.
Device
Program Counter
Program Counter High Byte PCL Register
BS82B12A-3 PC10~PC8
PCL7~PCL0
BS82C16A-3 PC11~PC8
BS82D20A-3 PC12~PC8
ThelowerbyteoftheProgramCounter,knownastheProgramCounterLowregisterorPCL,is
availableforprogramcontrolandisareadableandwriteableregister.Bytransferringdatadirectly
intothisregister,ashortprogramjumpcanbeexecuteddirectly,however,asonlythislowbyte
isavailableformanipulation,thejumpsarelimitedtothepresentpageofmemory,thatis256
locations.Whensuchprogramjumpsareexecuteditshouldalsobenotedthatadummycycle
willbeinserted.ManipulatingthePCLregistermaycauseprogrambranching,soanextracycleis
neededtopre-fetch.