在c语言里怎么调用汇编函数

更新时间:02-10 教程 由 毒盅 分享

在c语言里怎么调用汇编函数?

把汇编写在另一个文件里 在main写个原型声明 再把两个文件同时编译可不可以。我的gcc编译器里是这样写的汇编文件m.s.file "stdio.h"#hellowrold.s print "hello,world!".section .data output: .ascii "%d %d %d\0".section .text.globl _fun_fun: pushl %ebp movl %esp, %ebp subl $16, %esp movl 0x8(%ebp), %eax movl %eax, 0x4(%esp) movl 0xc(%ebp), %eax movl %eax, 0x8(%esp) movl 0x10(%ebp), %eax movl %eax, 0xc(%esp) movl $output, %eax movl %eax, (%esp) call _printf movl %ebp, %esp popl %ebp ret.end主函数前的原型声明 extern int fun(int i, int j, int k);

声明:关于《在c语言里怎么调用汇编函数》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2304676.html