Some questions about S12Z Assembler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Some questions about S12Z Assembler

862 Views
zhanhui
Contributor II

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
}
}

Tags (1)
0 Kudos
3 Replies

433 Views
leishuilong
Contributor I

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!

0 Kudos

433 Views
zhanhui
Contributor II

hope to get your help ,it is very important to me, thanks!!!!!!

0 Kudos

433 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

This seems to be answered in this thread:

https://community.nxp.com/thread/457345 

Regards,

Daniel

0 Kudos