EasyManua.ls Logo

Holtek HT48R05A-1 - Stack

Default Icon
125 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Note 1. PC10~PC8: Current Program Counter bits
2. @7~@0: PCL bits
3. #10~#0: Instruction code bits
4. S10~S0: Stack register bits
5. For the HT48R08A-1/HT48C08 and HT48R09A-1/HT48C09, the Program Counter is 11 bits
wide, i.e. from b10~b0.
6. For the HT48R06A-1/HT48C06 and HT48R07A-1/HT48C07, since their Program Counter
is 10 bits wide, the b10 column in the table is not applicable.
7. For the HT48R05A-1/HT48C05, since its Program Counter is 9 bits wide, the b9 and b10
columns in the table are not applicable.
Stack
This is a special part of the memory which is used to save the contents of the Program Counter
only. The stack is organized into two levels and is neither part of the data nor part of the program
space, and is neither readable nor writable. The activated level is indexed by the Stack Pointer
(SP) and is neither readable nor writable. At a subroutine call or interrupt acknowledge signal, the
contents of the Program Counter are pushed onto the stack. At the end of a subroutine or an inter-
rupt routine, signaled by a return instruction (RET or RETI), the Program Counter is restored to its
previous value from the stack. After a chip reset, the Stack Pointer will point to the top of the stack.
If the stack is full and an enabled interrupt takes place, the interrupt request flag will be recorded
but the acknowledge signal will be inhibited. When the Stack Pointer is decremented (by RET or
RETI), the interrupt will be serviced. This feature prevents stack overflow allowing the program
-
mer to use the structure more easily. However, when the stack is full, a CALL subroutine instruc
-
tion can still be executed which will result in a stack overflow. Precautions should be taken to avoid
such cases which might cause unpredictable program branching. Only the most recent 2 return ad
-
dresses are stored.
Chapter 1 Hardware Structure
13
Mode
Program Counter Bits
b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Initial Reset 00000000000
External Interrupt 00000000100
Timer/Event Counter Overflow 00000001000
Skip Program Counter + 2
Loading PCL PC10 PC9 PC8 @7 @6 @5 @4 @3 @2 @1 @0
Jump, Call Branch #10 #9 #8 #7 #6 #5 #4 #3 #2 #1 #0
Return from Subroutine S10 S9 S8 S7 S6 S5 S4 S3 S2 S1 S0

Table of Contents