ZHCAFU0 October 2025 TDA4VM
注册的返回挂钩函数必须包含以下汇编代码,以便从异常处理程序恢复,但这仅用于序列测试。对于常规流程,不得执行此操作,因为这会生成异常序列。
void reg_return_hook (void)
{
__asm(" addkpc.d1 $PCR_OFFSET(test_fun), a0"); //Transfers the //test function
//address to a0.
__asm(" ldd.d1 *ECSP[1], a1");//Status is saved in a1
__asm(" rete.s1 a0,a1"); //rete, returns from the exception //to the beginning of the test function, as //a0 contains the test //function address
}