问题描述
尽管我到处搜索都找不到解决问题的方法.问题是II在C文件"hello.c"中定义了一个函数"hello_world()",我想在程序集中调用此函数文件 . "hello_assembly.asm".有人可以帮助我吗?谢谢.
Despite I searched everywhere I couldn't find any solution to my problem.The problem is that I I defined a function "hello_world() " in a C file "hello.c" and I want to call this function in an assembly file . "hello_assembly.asm" .Can anyone help me ?Thank you.
推荐答案
gcc文档应对此进行详细说明.
The gcc documentation should spell this out in more detail.
如果找不到适合您的编译器和环境的文档,建议您将C函数编译为汇编列表,并查看其如何期望传递参数以及退出时在堆栈中保留的内容.
If you couldn't find documentation for your compiler and environment, I'd suggest you compile your C function to an assembler listing and look at how it expects arguments to be passed in and what it leaves on the stack when exiting.
这篇关于在汇编中调用C函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!