HT45R37
Program Counter
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 writable register.
By transferring data directly into this register, a short pro-
gram 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 loca-
tions. When such program jumps are executed it should
also be noted that a dummy cycle will be inserted.
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. It must be
noted that only the lower 8 bits, known as the Program
Counter Low Register, are directly addressable.
The lower byte of the Program Counter is fully accessi-
ble under program control. Manipulating the PCL might
cause program branching, so an extra cycle is needed
to pre-fetch. Further information on the PCL register can
be found in the Special Function Register section.
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 condi-
tional skip instructions, once the condition has been
met, the next instruction, which has already been
fetched during the present instruction execution, is dis-
carded and a dummy cycle takes its place while the cor-
rect instruction is obtained.
Program Counter Bits
Mode
b11 b10
b9
0
0
0
0
0
0
0
0
0
0
0
b8
0
0
0
0
0
0
0
0
0
0
0
b7
0
0
0
0
0
0
0
0
0
0
0
b6
0
0
0
0
0
0
0
0
0
0
0
b5
0
0
0
0
0
0
0
0
0
0
0
b4
0
0
0
0
1
1
1
1
1
1
1
b3
0
0
1
1
0
0
0
1
1
1
1
b2
0
1
0
1
0
1
1
0
0
0
0
b1
0
0
0
0
0
0
0
0
0
0
0
b0
0
0
0
0
0
0
0
0
0
0
0
Initial Reset
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
External Interrupt 0
External Interrupt 1
Timer/Event Counter 0 Overflow
Timer/Event Counter 1 Overflow
SPI/I2C Interrupt
C/R to F Converter Interrupt
Time Base Interrupt
RTC Interrupt
A/D Converter Interrupt
External Peripheral Interrupt
Skip
Program Counter + 2
PC11 PC10 PC9 PC8 @7 @6 @5 @4 @3 @2 @1 @0
Loading PCL
Jump, Call Branch
Return from Subroutine
#11 #10
#9
#8
S8
#7
S7
#6
S6
#5
S5
#4
S4
#3
S3
#2
S2
#1
S1
#0
S0
S11 S10 S9
Program Counter
Note: PC11~PC8: Current Program Counter bits
#11~#0: Instruction code address bits
@7~@0: PCL bits
S11~S0: Stack register bits
Rev. 1.20
10
February 25, 2011