indirect call

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

indirect call

跳至解决方案
1,457 次查看
Eric_t
Contributor III

Hi, everybody

 

I have to make an indirect call or jump but i do not know how to do it.

 

For example i have to make the following jump or call: 

 

                               Address FE00: CA 00 54 78 53 FA ....

                                  

                              I have to make a jump or call at the address which

                              contained in address FE00 (jump to CA00 address). 

 

Can anyone tell me how can i do it in assemby or C?

I am using the mc9s12dg256 controller and codewarrior v3.1. 

 

Thanks

Nikos 

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,256 次查看
kef
Specialist I

asm:

asm{

   LDX   0xFE00

   JMP   0,X

}

 

C:

typedef void (** near pfptr)(void);

 

{

   (*((pfptr)(void*)0xFE00))(); // jump to subroutine, whose 16bit address is stored at 0xFE00

}

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,257 次查看
kef
Specialist I

asm:

asm{

   LDX   0xFE00

   JMP   0,X

}

 

C:

typedef void (** near pfptr)(void);

 

{

   (*((pfptr)(void*)0xFE00))(); // jump to subroutine, whose 16bit address is stored at 0xFE00

}

0 项奖励
回复
1,256 次查看
Eric_t
Contributor III

Thank you for your help, kef

 

 

 

0 项奖励
回复