
HT1130
9
May24,1999
programmemoryaddress.Forthisreasonajump
instruction should first be used to place the pro-
gram counter in the right page. The above in-
structions can then be used to read the look up
table data.
Note that the page number n must be greater
than zero as some locations in page 0 are re-
served for specific usage. This area may func-
tion as a normal program memory when
required.
The program memory mapping is shown in
thediagram.
In the execution of an instruction the pro-
gram counter is added before the execution
phase, so careful manipulation of READ
MR0A and READ R4A is needed in the page
margin.
Stackregister
The stack register is a group of registers used to
save the contents of the program counter (PC)
and is arranged in 13 bits
′
1 level. One bit is
used to store the carry flag. An interrupt will
force the contents of the PC and the carry flag
onto the stack register. A subroutine call will
also cause the PC contents to be pushed onto
the stack; however the carry flag will not be
stored. At the end of a subroutine or an inter-
rupt (indicated by a return instruction RET or
RETI), the contents of the stack register are re-
turnedtothePC.
Executing "RETI" instruction will restore the
carry flag from the stack register, but RET does
not.
Workingregisters
-
R0,R1,R2,R3,R4
There are five working registers (R0, R1, R2,
R3, R4) used to store the frequently accessed in-
termediate results. Using the instructions INC
Rn and DEC Rn, the working registers can in-
crement (+1) or decrement (
-
1). The JNZ Rn
(n=0,1,4) instruction makes efficient use of the
working registers as a program loop counter.
The register pairs R0,R1 and R2,R3 are also
used as a data memory pointer when the mem-
orytransferinstructionisexecuted.
Datamemory
-
RAM
The static data memory (RAM) is arranged in
256
′
4 bit format and is used to store data. All of
the data memory locations are indirectly ad-
dressable through the register pair R1,R0 or
R3,R2; for example MOV A,[R3R2] or MOV
[R3R2],A.
There are two areas in the data memory, the
temporary data area and the display data area.
Access to the temporary data area is from 00H
to 7FH. Locations E0H to FFH represent the
display data area. The locations between the
temporary and display data areas are unde-
finedandcannotbeused.
When data is written into the display data area, it
isautomaticallyreadbytheLCDdriverwhichthen
generates the corresponding LCD driving signals.
Accumulator
-
ACC
The accumulator is the most important data
register in the processor. It is one of the sources
of input to the ALU and the destination of the
results of the operations performed in the ALU.
Data to and from the I/O ports and memory also
passthroughtheaccumulator.
Arithmeticandlogicunit
-
ALU
This circuit performs the following arithmetic
andlogicoperations...
·
Addwithorwithoutcarry
·
Subtractwithorwithoutcarry
·
AND,OR,Exclusive-OR
·
Rotateright,leftthroughcarry
4 b i t s
Datamemory
T e m p o r a r y D a t a A r e a
( 1 2 8 x 4 )
U n d e f i n e d A r e a
( 9 6 x 4 )
D i s p l a y D a t a A r e a
( 3 2 x 4 )
0 0 H
8 0 H
E 0 H
F F H
D a t a R A M