Including assembly code

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Including assembly code

956件の閲覧回数
beenu
Contributor I

How do I include assembly code in a C file

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

800件の閲覧回数
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 件の賞賛
返信

800件の閲覧回数
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 件の賞賛
返信