HT83R074
Rev. 1.00
9
May 17, 2007
Program Memory
ROM
The program memory stores the program instructions
that are to be executed. It also includes data, table and
interrupt entries, addressed by the program counter
along with the table pointer. The program memory size
for HT83R074 is 2048 15 bits. Certain locations in the
program memory are reserved for special usage:
Location 000H
This area is reserved for program initialization. The
program always begins execution at location 000H
each time the system is reset.
Location 004H
This area is reserved for the time base interrupt ser-
vice program. If the ETBI (intc.1) is activated, and the
interrupt is enabled and the stack is not full, the pro-
gramwilljumptolocation004Handbeginsexecution.
Location 008H
This area is reserved for the 8-bit Timer Counter 0 in-
terrupt service program. If a timer interrupt results
from a Timer Counter 0 overflow, and if the interrupt is
enabled and the stack is not full, the program will jump
to location 008H and begins execution.
Location 00CH
This area is reserved for the 8-bit Timer Counter 1 in-
terrupt service program. If a timer interrupt results
from a Timer Counter 1 overflow, and if the interrupt is
enabled and the stack is not full, the program will jump
to location 00CH and begins execution.
Table Location
Any location in the ROM space can be used as look up
tables. The instructions TABRDC [m] (used for any
bank) and TABRDL[m] (only used for last page of pro-
gram ROM) transfer the contents of the lower-order byte
to the specified data memory [m], and the higher-order
byte to TBLH (08H). Only the destination of the
lower-order byte in the table is well-defined. The
higher-order bytes of the table word are transferred to
the TBLH. The table higher-order byte register (TBLH)
is read only.
The table pointer (TBLP) is a read/write register, which
indicates the table location.
Stack Register
Stack
The stack register is a special part of the memory used
to save the contents of the Program Counter. This stack
is organized into four levels. It is neither part of the data
nor part of the program space, and cannot be read or
written to. Its activated level is indexed by a Stack
Pointer (SP) and cannot be read or written to. At a sub-
routinecallorinterruptacknowledgment,thecontentsof
the program counter are pushed onto the stack.
The program counter is restored to its previous value
from the stack at the end of subroutine or interrupt rou-
tine, which is signaled by return instruction (RET or
RETI). After a chip resets, SP will point to the top of the
stack.
The interrupt request flag will be recorded but the ac-
knowledgment will be inhibited when the stack is full and
a non-masked interrupt takes place. After the stack
pointer is decremented (by RET or RETI), the interrupt
request will be serviced. This feature prevents stack
overflow and allows programmers to use the structure
more easily. In a similar case, if the stack is full and a
CALL is subsequently executed, stack overflow oc-
curs and the first entry is lost.
Instruction
Table Location
*10
*9
*8
*7
*6
*5
*4
*3
*2
*1
*0
TABRDC [m]
P10
P9
P8
@7
@6
@5
@4
@3
@2
@1
@0
TABRDL [m]
1
1
1
@7
@6
@5
@4
@3
@2
@1
@0
Table Location
Note: *10~*0: Current program ROM table
@7~@0: Write @7~@0 to TBLP pointer register
P10~P8: Bits of current program counter
=
- =
' =
=
0 %
% .
%
3 %
)
% %
3 %
)
% %
3 %
)
5 ; ; =
1 =
Program Memory