OS_STK *OSTaskStkInit (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT16U opt){INT16U *stk;opt = opt; /* 'opt' is not used, prevent warning */stk = (INT16U *)ptos; /* Load stack pointer */*stk-- = (INT16U)FP_SEG(pdata); /* Simulate call to function with argument */*stk-- = (INT16U)FP_OFF(pdata); *stk-- = (INT16U)FP_SEG(task);*stk-- = (INT16U)FP_OFF(task);*stk-- = (INT16U)0x0202; /* SW = Interrupts enabled */*stk-- = (INT16U)FP_SEG(task); /* Put pointer to task on top of stack */*stk-- = (INT16U)FP_OFF(task);*stk-- = (INT16U)0xAAAA; /* AX = 0xAAAA */*stk-- = (INT16U)0xCCCC; /* CX = 0xCCCC */*stk-- = (INT16U)0xDDDD; /* DX = 0xDDDD */*stk-- = (INT16U)0xBBBB; /* BX = 0xBBBB */*stk-- = (INT16U)0x0000; /* SP = 0x0000 */*stk-- = (INT16U)0x1111; /* BP = 0x1111 */*stk-- = (INT16U)0x2222; /* SI = 0x2222 */*stk-- = (INT16U)0x3333; /* DI = 0x3333 */*stk-- = (INT16U)0x4444; /* ES = 0x4444 */*stk = _DS; /* DS = Current value of DS */return ((OS_STK *)stk);}还有就是例如*stk-- = (INT16U)0xAAAA; 后面的oxAAAA,0XCCCC,等定义的都是什么啊
1 回答
倚天杖
TA贡献1828条经验 获得超3个赞
应该问*stk--=.......是什么。
如果写成*(stk--)=....是什么你可能就知道了,这里不加括号也是一样的。
后面的oxAAAA,0XCCCC都是些地址值。
- 1 回答
- 0 关注
- 229 浏览
添加回答
举报
0/150
提交
取消