Including assembly code

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

Including assembly code

952 Views
beenu
Contributor I

How do I include assembly code in a C file

Labels (1)
0 Kudos
Reply
2 Replies

796 Views
iansmusical
Contributor V

Hello Beenu,

Usually assembly code can be included in a C file by using either an asm(); statement or an assembler macro. The asm(); statement allows the injection of maybe one or two assembler statements and the assembler macro allows for a whole assembler function or collection of statements.

Check the CodeWarrior documentation to see the exact syntax required.

Thanks,

Ian

0 Kudos
Reply

796 Views
weapon
Senior Contributor I

Hi Winner,

You can use __asm keyword. please try search this keyword in hcs08 compiler manual, you can see the example. I listed below for you.

Listing: Examples of the __asm Keyword

__asm { nop

nop ; comment

}

asm ("nop; nop");

__asm("nop\n nop");

__asm "nop";

__asm nop;

#asm

nop

nop

#endasm

XWP

0 Kudos
Reply