Datasheet

SP
1
SP
old
SP
1
PUSH SP
The stack pointer is changed after
a PUSH SP instruction.
SP
1
SP
2
POP SP
The stack pointer is not changed after a POP SP
instruction. The POP SP instruction places SP1 into the
stack pointer SP (SP2=SP1)
I3
I1
I2
I3
0xxxh
0xxxh − 2
0xxxh − 4
0xxxh − 6
0xxxh − 8
I1
I2
SP
0123h
SP
I1
I2
I3
SP
PUSH #0123h
POP R8Address
0123h
www.ti.com
CPU Registers
The PC can be addressed with all instructions and addressing modes. A few examples:
MOV #LABEL,PC ; Branch to address LABEL
MOV LABEL,PC ; Branch to address contained in LABEL
MOV @R14,PC ; Branch indirect to address in R14
3.2.2 Stack Pointer (SP)
The stack pointer (SP/R1) is used by the CPU to store the return addresses of subroutine calls and
interrupts. It uses a predecrement, postincrement scheme. In addition, the SP can be used by software
with all instructions and addressing modes. Figure 3-3 shows the SP. The SP is initialized into RAM by the
user, and is aligned to even addresses.
Figure 3-4 shows stack usage.
Figure 3-3. Stack Counter
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Stack Pointer Bits 15 to 1 0
MOV 2(SP),R6 ; Item I2 -> R6
MOV R7,0(SP) ; Overwrite TOS with R7
PUSH #0123h ; Put 0123h onto TOS
POP R8 ; R8 = 0123h
Figure 3-4. Stack Usage
The special cases of using the SP as an argument to the PUSH and POP instructions are described and
shown in Figure 3-5.
Figure 3-5. PUSH SP - POP SP Sequence
3.2.3 Status Register (SR)
The status register (SR/R2), used as a source or destination register, can be used in the register mode
only addressed with word instructions. The remaining combinations of addressing modes are used to
support the constant generator. Figure 3-6 shows the SR bits.
45
SLAU144JDecember 2004Revised July 2013 CPU
Submit Documentation Feedback
Copyright © 2004–2013, Texas Instruments Incorporated