AnsweredAssumed Answered

S12ZVC assembly instruction and S12G assembly instruction, what can I do?

Question asked by jiakai hua on Aug 7, 2017
Latest reply on Aug 24, 2017 by MJW

Because working reason I met problems.My company want to abandon S12G, new products all use S12ZVC.In order to reduce the development cycle, the company wanted to transplant some of the S12G code to the S12ZVC.Old product use S12G, although most of the code of transplant is no problem, but the migration problems appeared on the assembly code.I posted these S12G below code, hope someone know how to change the code to transplant to S12ZVC,Thank you very much!(My native language is not English, I didn't work hard enough to learn English, my English is very poor, I hope you understand)

/****************************************************************************
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
****************************************************************************/



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
}

/****************************************************************************
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
****************************************************************************/

asm{
tba ; b to a
tap ; load accumulator to ccr
}

Outcomes