Mixing C and Assembler in CodeWarrior v6.3

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

Mixing C and Assembler in CodeWarrior v6.3

1,868 次查看
freeman
Contributor I
I'd like to know if it's still possible or recommended to mix C and assembler in CodeWarrior V6.3.  If so, where can I get more info?
 
Thanks!
标签 (1)
标记 (1)
0 项奖励
回复
1 回复

703 次查看
CrasyCat
Specialist III
Hello
Not sure how deep you need to go here.
Basically if you want to mix C and assembly in an application, you have to keep the following in mind:
 - The way you are passing parameters or getting return value in assembly source file should match the 
    compiler calling convention.
    Calling convention is described in {Install}\Help\PDF\ColdFire_Build_Tools_Reference.pdf, in chapter
    "ColdFire Code Generation" section "Calling Conventions".
 - The Compiler is adding an _ prefix to symbol names. If you want to call an ANSI C function from
    assemble or refer to an ANSI C variable from assembler source file you have to add a leading _
    character  to the symbol name. So if the function is called myCFunc in C source file, refer it as
   _myCFunc in assembler.
 
 I hope this helps a bit.
CrasyCat
0 项奖励
回复