Trouble with CW 10 linking Coldfire assy lang object file

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

Trouble with CW 10 linking Coldfire assy lang object file

1,027 次查看
Ainslie
Contributor II

I am trying to call an assy lang routine from C but the linker always shows undefined symbol. The file is being assembled, and I can create a list file. CW7 forced me to prefix the routine with an underscore, but that appears to make no difference here on CW 10.

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

623 次查看
CrasyCat
Specialist III

Hello

 

In the assembly source file the function name should start with an underscore and be defined as global.

This is done as follows:

 

   .global _foo      .text_foo:   nop   nop   nop   rts

 

 

In ANSI C module you need a prototype for the function without underscore as follows:

 

void foo(void);

 This should work.

 

CrasyCat

0 项奖励
回复