| 数据搜索系统,热门电子元器件搜索 |
|
ST9291 数据表(PDF) 16 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST9291 数据表(HTML) 16 Page - STMicroelectronics |
|
16 / 20 page ![]() 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. 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. ® ST9291 16/20 |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| 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 |