首页|嵌入式系统|显示技术|模拟IC/电源|元件与制造|其他IC/制程|消费类电子|无线/通信|汽车电子|工业控制|医疗电子|测试测量
首页 > 分享下载 > 嵌入式系统 > PIC18微控制器的堆栈操纵

PIC18微控制器的堆栈操纵

资料介绍
Traditionally, the microcontroller stack has only been
used as a storage space for return addresses of sub-
routines or interrupt routines, where all ‘push’ and ‘pop’
operations were hidden. For the most part, users had
no direct access to the information on the stack. The
PIC18 microcontroller diverges from this tradition
slightly. With the new PIC18 core, users now have
access to the stack and can modify the stack pointer
and stack data directly. Having such levels of access to
the stack allows for some unique and interesting
programming possibilities.
This application note describes specific information,
registers, and instructions related to accessing the
stack. An example is also included demonstrating a
very simple task manager, an essential element for a
real-time operating system (RTOS).
M AN818
Manipulating the Stack of the PIC18 Microcontroller

Author: Ross M. Fosler The pointer to the top of the stack is provided in register
Microchip Technology Inc. STKPTR. The pointer is only five-bits wide, which
accounts for a stack depth of 32 words. However, the
first location is not counted, since it is not physically a
INTRODUCTION memory location in the stack. The first location always
Traditionally, the microcontroller s
标签:堆栈操纵PIC18
PIC18微控制器的堆栈操纵
本地下载

评论