Including assembly code

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

Including assembly code

962 次查看
beenu
Contributor I

How do I include assembly code in a C file

标签 (1)
0 项奖励
回复
2 回复数

806 次查看
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 项奖励
回复

806 次查看
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 项奖励
回复