- 打卡等级:初来乍到
- 打卡总天数:9
- 最近打卡:2025-04-23 15:28:46
等待验证会员
- 积分
- 223
|
系统中sp指针的保存和恢复如下:
/* Saves the stack pointer for one task into its TCB. */
#define portSAVE_SPX() \
{ \
__asm { MOV DR0,DR60 } \
__asm { MOV DR4,pxCurrentTCB } \
__asm { MOV @WR6+0x2,WR2 } \
}
/* Restores the stack from the new TCB read to
run the task. */
#define portRESTORE_SPX() \
{ \
__asm { MOV DR4,pxCurrentTCB } \
__asm { MOV WR2,@WR6+0x2 } \
__asm { XRL WR0,WR0 } \
__asm { MOV DR60,DR0 } \
}
为什么不直接【 __asm { MOV pxCurrentTCB ,DR60 } 】和【__asm { MOV DR60,pxCurrentTCB } 】呢?
原文中SPX的操作我理解的仅仅是对低字节,高字节有其他信息么?
|
|