最近在看PIC18的UCOSII移植范例,原作者Nathan Brown写的堆栈初始化函数OSTaskStkInit里面涉及到了PIC18XXXX的寄存器操作,涉及到了4个寄存器AARGB0~AARGB3,可是我在PIC的datasheet上根本搜索不到与之相关的任何内容,这个是怎么回事呢?原代码如下,请看蓝色字体的部分,PIC没这个寄存器啊
OS_STK *OSTaskStkInit (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT16U opt)
{
OS_STK *stk;
stk = ptos; // local pointer to our new proccess stack
*stk++ = (OS_STK)*(((INT8U*)&pdata)); // data being passed
*stk++ = (OS_STK)*(((INT8U*)&pdata)+1);
*stk++ = 0xFF; // <-- FSR1 Pointer position on function call.
*stk++ = 0x1A; // STATUS register
*stk++ = 0x1B; // BSR register
*stk++ = 0x1C; // W register
*stk++ = 0x1D; // FSR0L register
*stk++ = 0x1E; // FSR0H register
*stk++ = 0x1F; // FSR2L register
*stk++ = 0x2A; // FSR2H register
*stk++ = 0x2B; // TBLPTRL Prog Mem Table Pointer Upper
*stk++ = 0x2C; // TBLPTRH Prog Mem Table Pointer High
*stk++ = 0x2D; // TBLPTRU Prog Mem Table Pointer Low
*stk++ = 0x2E; // PRODL Product Reg high
*stk++ = 0x2F; // PRODH Product Reg low
*stk++ = 0x3A; // AARGB3
*stk++ = 0x3B; // AARGB2
*stk++ = 0x3C; // AARGB1
*stk++ = 0x3D; // AARGB0
|