Cpu Special-Function Registers (Sfrs) - Intel 8XC196NT User Manual

Table of Contents

Advertisement

8XC196NT USER'S MANUAL
Subroutines may be nested. That is, each subroutine may call other subroutines. The CPU
PUSHes the contents of the program counter onto the stack each time it executes a subroutine call.
The stack grows downward as entries are added. The only limit to the nesting depth is the amount
of available memory. As the CPU returns from each nested subroutine, it POPs the address off
the top of the stack, and the next return address moves to the top of the stack.
Your program must load a word-aligned (even) address into the stack pointer. Select an address
that is two bytes (for 64-Kbyte mode) or four bytes (for 1-Mbyte mode) greater than the desired
starting address because the CPU automatically decrements the stack pointer before it pushes the
first byte of the return address onto the stack. Remember that the stack grows downward, so allow
sufficient room for the maximum number of stack entries. The stack must be located in page 00H,
in either the internal register file or external RAM. The stack can be used most efficiently when
it is located in the upper register file.
The following example initializes the top of the upper register file as the stack.
LD
SP, #400H
4.2.5.3

CPU Special-function Registers (SFRs)

Locations 0000–0017H in the lower register file are the CPU SFRs (see Table 4-8). Appendix C
describes the CPU SFRs.
4-14
;Load stack pointer
Table 4-8. 8XC196NT CPU SFRs
Address
High (Odd) Byte
0016H
Reserved
0014H
Reserved
0012H
INT_MASK1
0010H
Reserved
000EH
Reserved
000CH
Reserved
000AH
Reserved
0008H
INT_PEND
0006H
PTSSRV (H)
0004H
PTSSEL (H)
0002H
ONES_REG (H)
0000H
ZERO_REG (H)
Low (Even) Byte
Reserved
WSR
INT_PEND1
Reserved
Reserved
Reserved
WATCHDOG
INT_MASK
PTSSRV (L)
PTSSEL (L)
ONES_REG (L)
ZERO_REG (L)

Advertisement

Table of Contents
loading

Table of Contents