assembly in cw

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

assembly in cw

1,386 Views
perfume
Contributor I
hi, I'm a new user of cw for codefire 6.3 targetting M52233demo and I am having difficulty in building a new assembly file. It seems I can not build a simple assembly since there are choices only for c,cpp,ecpp. Then I tried inline assembly like asm{...} regarding to the inline assembly in coldfire_build_tools_reference, but there are too many error like "unknown assembler instruction mnemonic". What should I do to make a assemly source file or do I need to do some special setting? Thanks so  much.
Labels (1)
0 Kudos
1 Reply

396 Views
SimonMarsden_de
Contributor II
If the source file has extension ".s" the CodeWarrior assembler will be invoked.

Here's a really simple example of an assembler file:

    .text
    .globl   _add_em
_add_em:
    move.l   #1,d0
    add.l      #2,d0
    rts

This can be called from C in the following way:

    extern int fred (void);
    ....
    result = fred ();

   
0 Kudos