indirect call

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
653件の閲覧回数
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 解決策
452件の閲覧回数
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 返答(返信)
453件の閲覧回数
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 件の賞賛
452件の閲覧回数
Eric_t
Contributor III

Thank you for your help, kef

 

 

 

0 件の賞賛