Mixing C and Assembler in CodeWarrior v6.3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mixing C and Assembler in CodeWarrior v6.3

1,443 Views
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!
Labels (1)
0 Kudos
1 Reply

278 Views
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 Kudos