.macro PUSHRS ST -Y,R0 ST -Y,R1 ST -Y,R2 ST -Y,R3 ST -Y,R4 ST -Y,R5 ST -Y,R6 ST -Y,R7 ST -Y,R8 ST -Y,R9 ST -Y,R10 ST -Y,R11 ST -Y,R12 ST -Y,R13 ST -Y,R14 ST -Y,R15 ST -Y,R16 ST -Y,R17 ST -Y,R18 ST -Y,R19 ST -Y,R20 ST -Y,R21 ST -Y,R22 ST -Y,R23 ST -Y,R24 ST -Y,R25 ST -Y,R26 ST -Y,R27 ST -Y,R30 ST -Y,R31 IN R16,RAMPZ ST -Y,R16 .endmacro
很容易理解以上宏定义“PUSHRS”是为了把寄存器的内容存到Y指向的位置,但是在执行“PUSHRS”时Y的值怎么好像是不定的? 我理解执行“PUSHRS”前,(即执行OSCtxSw()前),应该先把当前任务的栈顶赋值给Y,再进行任务调度?不知对否?在ucos程序里我就没有看到有这样的程序!!所以请高人指点!!谢谢!! |