LCD Type MCU
For instructions involving branches, such as jump or call instructions, two machine cycles are re-
quired to complete instruction execution. An extra cycle is required as the program takes one cy-
cle to first obtain the actual jump or call address and then another cycle to actually execute the
branch. The requirement for this extra cycle should be taken into account by programmers in tim-
ing sensitive applications
1
2
3
4
5
6
D E L A Y :
:
N O P
:
M O V A ,[1 2 H ]
C A L L D E L A Y
C P L [1 2 H ]
F e tc h In s t. 1
E x e c u te In s t. 1
F e tc h In s t. 2
E x e c u te In s t. 2
F e tc h In s t. 3
F lu s h P ip e lin e
F e tc h In s t. 6
E x e c u te In s t. 6
F e tc h In s t. 7
Program Counter
During program execution, the Program Counter is used to keep track of the address of the next in-
struction to be executed. It is automatically incremented by one each time an instruction is exe-
cuted except for instructions, such as
²JMP²
or
²CALL²
that demand a jump to a non-consecutive
Program Memory address. For the LCD Type MCU series, note that the Program Counter width
varies with the Program Memory capacity depending upon which device is selected. However, it
must be noted that only the lower 8 bits, known as the Program Counter Low Register are directly
addressable by user.
When executing instructions requiring jumps to non-consecutive addresses, such as a jump in-
struction, 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 pres-
ent instruction execution, is discarded and a dummy cycle takes its place while the correct instruc-
tion is obtained.
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 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 loca-
tions. When such program jumps are executed it should also be noted that a dummy cycle will be
inserted.
For the HT49RU80/HT49CU80 devices, whose Program Memory is stored in two Banks, note that
the Bank selection is under the control of bit 5 of the Bank Pointer. It is this Bank Pointer bit that
controls the highest address bit of the Program Counter as shown in the following diagram:
1 3 1 2
8 7
P ro g ra m
B P
.5
0
C o u n te r
B a n k P o in te r (B P )
22
Home Index Bookmark Pages Text
Previous Next
Pages: Home Index