ST9291 ST Microelectronics, ST9291 Datasheet - Page 16

no-image

ST9291

Manufacturer Part Number
ST9291
Description
16-48K ROM HCMOS MCU WITH ON SCREEN DISPLAY AND VOLTAGE TUNINGOUTPUT
Manufacturer
ST Microelectronics
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ST9291-CHI
Manufacturer:
ST
0
Part Number:
ST9291J4B1/EEC
Manufacturer:
ST
0
Part Number:
ST9291J4B1/EEL
Manufacturer:
ST
0
Part Number:
ST9291J4B1/EKH
Manufacturer:
ST
0
Part Number:
ST9291J5B1/EHM
Manufacturer:
ST
0
Part Number:
ST9291J6B1/EBB
Manufacturer:
ST
Quantity:
20 000
Part Number:
ST9291J6B1/EHJ
Manufacturer:
ST
Quantity:
3 000
Part Number:
ST9291J7B1/AIS
Manufacturer:
SGS-THOMSON
Quantity:
4 190
ST9291
SYSTEM REGISTERS (Continued)
1.1.3.6 Stack Pointers
There are two separate, double register stack
pointers available (named System Stack Pointer
and User Stack Pointer), both of which can ad-
dress registers or memory.
The stack pointers point to the bottom of the stacks
which are filled using the push commands and
emptied using the pop commands. The stack
pointer is automatically pre-decremented when
data is “pushed in” and post-incremented when
data is “popped out”.
For example, the register address space is se-
lected for a stack and the corresponding stack
pointer register contains 220. When a byte of data
is “pushed”into the stack, the stack pointer register
is decremented to 219, then the data byte is
“loaded” into register 219. Conversely, if a stack
pointer register contains 189 and a byte of data is
“popped” out, the byte of data is then extracted
from the stack and then the stack pointer register is
incremented to 190.
The push and pop commands used to manage
the system stack area are made applicable to the
user stack by adding the suffix U, while to use a
stack instruction for a word a W is added.
For example push inserts data into the system
stack, but an added U indicates the user stack and
W means a word, so the instruction pushuw loads
a word into the bottom of the user stack.
If the User Stack Pointer register contains 223
(working in register space) the instruction pushuw
will decrement User Stack Pointer register to 222
and then load a word into register R222 and R221.
When bytes (or words) are “popped out” the values
in those registers are left unchanged until fresh
data is loaded into those locations. Thus when
data is “popped” out from a stack area, the stack
content remains unchanged.
Note. Stacks must not be located in the pages or
the system register area.
16/20
The System Stack area and The System Stack
Pointer
The System Stack area is used for the storage of
temporarily suspended system and/or control reg-
isters, i.e. the Flag register and the Program
counter, while interrupts are being serviced. For
subroutine execution only the Program Counter
needs to be saved in the System stack area.
There are two situations when this occurs automat-
ically, one being when an interrupt occurs and the
other when the instruction call subroutine is used.
When the system stack area is in the Register File,
the stack pointer, which points to the bottom of the
stack, only needs one byte for addressing, in which
case the System Stack Pointer Low Register
(R239) is sufficient for addressing purposes. As a
result the System Stack Pointer High Register
(R238) becomes redundant BUT must be consid-
ered as reserved (please refer also to “spurious”
memory access section). Clearly when the stack is
external a full word address is necessary and so
both registers are used to point, the even register
providing the MSB and the odd register providing
the LSB.
The User Stack area and User Stack Pointer
The User Stack area is completely free from all in-
terference from automatic operations and so it pro-
vides a totally user controlled stacking area, that
area being in any part of the memory which is of a
RAM nature, or the first 14 groups of the general
Register File i.e. not in the System register or
Paged group.
The User Stack Pointer consists of two registers,
R236 and R237, which are both used for address-
ing an external stack, while, when stacking in the
Register File, the User Stack Pointer High Regis-
ter, R236, becomes redundant but must be consid-
ered as reserved.

Related parts for ST9291