Calling c functions from assembly file in codewarrior for MCF5485 Coldfire

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Calling c functions from assembly file in codewarrior for MCF5485 Coldfire

1,877件の閲覧回数
preetuabraham
Contributor III

Hi,

 

 

I am working with "CodeWarrior for MCU Version: 10.6" for MCF5485 coldfire .

I have some functions in my C-File. I have to call those function in the .s file.

 

Could you please give me the procedure to call the functions and to pass the parameters.

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,357件の閲覧回数
miduo
NXP Employee
NXP Employee

Hi,

Assembly language programs can call the functions written in either C or assembly language. From within the assembly language instructions, you can call the C functions. For example, if the C function definition is:

int  my_c_func ( int  i)

{

 return  i++;

}

the assembly language calling statement should be:

jsr _my_c_func

0 件の賞賛
返信

1,357件の閲覧回数
TomE
Specialist II

Search this forum for "calling c from assembly" and see if any of them help.I gave up counting at ONE HUNDRED. You should search before posting (and if you have searched and found nothing, say so, and detail why your problem is different from the previous ones).

Watch out that the ABI changed after CW 7.2, so any examples prior to that (MOST examples are prior to that) won't work on later CW versions.

I only know the ABI for gcc, and that's different to CW.

Why do you need to call C from Assembly? It is usually always better to get from Assembly into C ASAP and then stay there.

Tom

0 件の賞賛
返信