I I have used S12 MCU,and there are some Assembly code。Now i am using S12ZV(S12Z),and I want to transplant the assembly code(S12) to S12Z project to achieve the same function,but the Assembly instructions are different between S12 and S12Z,can you help me to write the code?
/****************************************************************************
Name : VStdLL_GlobalInterruptDisable
Called by : -
Preconditions : -
Parameters : tVStdIrqStateType* pOldState: pointer to the local irq state
Return values : none
Description : saves the current CCR value to *pOldState and disables the
global interrupt
****************************************************************************/
/* CODE CATEGORY 1 START*/
VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdLL_GlobalInterruptDisable(VSTD_DEF_P2VAR_PARA(VSTD_NONE, tVStdIrqStateType, AUTOMATIC, VAR_NEAR) pOldState) VSTD_API_2
{
asm{
pshy ; save index register
tfr d,y ; transfer pointer to index register
tpa ; load ccr to accumulator
sei ; disable global interrupt
staa 0,y ; store the value of ccr into loction pointed by pOldState
puly ; restore index register
}
}
/* CODE CATEGORY 1 END*/
/****************************************************************************
Name : VStdLL_GlobalInterruptRestore
Called by : -
Preconditions : -
Parameters : tVStdIrqStateType nOldState: value of the local irq state
Return values : none
Description : restores the CCR value stored in nOldState
****************************************************************************/
/* CODE CATEGORY 1 START*/
VSTD_DEF_FUNC_API(VSTD_NONE, void, CODE) VStdLL_GlobalInterruptRestore(tVStdIrqStateType nOldState) VSTD_API_2
{
asm{
tba ; b to a
tap ; load accumulator to ccr
}
}
Hi, Mr Liu
I have the same problem. Do you have solved this problem? If you have solved, please help me. My email is zxh_554@163.com. Thank you!
hope to get your help ,it is very important to me, thanks!!!!!!