数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

ST9 数据表(PDF) 31 Page - STMicroelectronics

部件名 ST9
功能描述  USER GUIDE
PDF  146 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

ST9 数据表(HTML) 31 Page - STMicroelectronics

Back Button ST9 Datasheet HTML 27Page - STMicroelectronics ST9 Datasheet HTML 28Page - STMicroelectronics ST9 Datasheet HTML 29Page - STMicroelectronics ST9 Datasheet HTML 30Page - STMicroelectronics ST9 Datasheet HTML 31Page - STMicroelectronics ST9 Datasheet HTML 32Page - STMicroelectronics ST9 Datasheet HTML 33Page - STMicroelectronics ST9 Datasheet HTML 34Page - STMicroelectronics ST9 Datasheet HTML 35Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 31 / 146 page
background image
31/146
ST9 USER GUIDE
3.2 STACK MODES
The ST9 allows you to have two separate stacks: a system stack and a user stack. The core
uses the system stack in interrupt routines and subroutines to save return addresses, the flag
register and the CSR depending on option (EMR2 register bit Enable Code Segment Reg-
ister). You can also use it under program control to save data, using the push and pop instruc-
tions.
The user stack works exactly the same way, using the pushu and popu instructions but only
under program control, which means that the user stack is not changed by the system. You
may choose to use a separate space for your data, or to store them in the same stack as the
return addresses.
Both stacks can independently be located either in RAM or in the register file. You select this
using the SSP and USP bits in the MODER register (R235) for the system stack and the user
stack, respectively. A low bit value selects a RAM stack, and a high bit value selects a Reg-
ister File stack.
Since the stacks grow towards low addresses, the stack pointers must be initialized to the
highest location plus one(3) of the space reserved to it. This location becomes the “bottom” of
the stack. When the stack is located in the register file, take care that it does not overwrite
other data, in particular the registers located in groups 14 (0EH) and 15 (0FH). For this reason
it is advisable to set the system stack pointer to the end of group 13 (0DH).
The last register of this group being R223, the instruction that sets the stack pointer will be:
ld
sspr, #224 ; set stack pointer to one above end of group 13
Note 1:
Using two separate stacks in the same kind of storage (memory or register) area is likely to con-
sume more space than if a single stack is used. So most of the time, only one stack will hold
both return addresses and arguments for functions. You can then use pushu and popu instruc-
tions to manipulate data with the convenience of auto incrementing or decrementing the pointer
after each access.
As an example, refer to the C language start-up files which initialize both the user and system
stacks.
The following diagram illustrates the two options for locating the stack: in the register file or in
memory.
(3) The push instruction decrements the stack pointer before writing the data, so this location
would never be used if set to the top location.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com