![Samsung S3P80C5 Скачать руководство пользователя страница 47](http://html1.mh-extra.com/html/samsung/s3p80c5/s3p80c5_user-manual_3993739047.webp)
ADDRESS SPACES
S3P80C5/C80C5/C80C8
2-18
SYSTEM AND USER STACKS
S3C8-series microcontrollers use the system stack for subroutine calls and returns and to store data. The PUSH
and POP instructions are used to control system stack operations.
The S3P80C5/C80C5/C80C8 architecture supports stack operations in the internal register file.
Stack Operations
Return addresses for procedure calls and interrupts and data are stored on the stack. The contents of the PC are
saved to stack by a CALL instruction and restored by the RET instruction. When an interrupt occurs, the contents
of the PC and the FLAGS register are pushed to the stack. The IRET instruction then pops these values back to
their original locations. The stack address value is always decreased by one
before
a push operation and
increased by one
after
a pop operation. The stack pointer (SP) always points to the stack frame stored on the top
of the stack, as shown in Figure 2-15.
Stack Contents
After a Call
Instruction
Stack Contents
After an Interrupt
Top of
Stack
FLAGS
PCH
PCL
PCL
PCH
Top of
Stack
Low Address
High Address
Figure 2-15. Stack Operations
User-Defined Stacks
You can freely define stacks in the internal register file as data storage locations. The instructions PUSHUI,
PUSHUD, POPUI, and POPUD support user-defined stack operations.
Stack Pointers (SPL)
Register location D9H contain the 8-bit stack pointer (SPL) that is used for system stack operations. After a reset,
the SPL value is undetermined. Because only internal memory 256-byte is implemented in
S3P80C5/C80C5/C80C8, the SPL must be initialized to an 8-bit value in the range 00H–FFH.
Содержание S3P80C5
Страница 2: ...S3P80C5 C80C5 C80C8 8 BIT CMOS MICROCONTROLLERS USER S MANUAL Revision 1 ...
Страница 5: ......
Страница 13: ......
Страница 15: ......
Страница 17: ......
Страница 19: ......
Страница 49: ...ADDRESS SPACES S3P80C5 C80C5 C80C8 2 20 NOTES ...
Страница 197: ...INSTRUCTION SET S3P80C5 C80C5 C80C8 6 88 NOTES ...
Страница 201: ...CLOCK CIRCUITS S3P80C5 C80C5 C80C8 7 4 NOTES ...
Страница 237: ...TIMER 1 S3P80C5 C80C5 C80C8 11 6 NOTES ...
Страница 245: ...COUNTER A S3P80C5 C80C5 C80C8 12 8 NOTES ...
Страница 255: ......
Страница 257: ......
Страница 259: ......
Страница 261: ......
Страница 263: ...BOOK SPINE TEXT SAMSUNG Logo S3P80C5 C80C5 C80C8 Microcontrollers User s Manual Rev 1 May 2002 ...