如何从Swift调用汇编函数

rel*_*357 8 assembly function swift

在xcode 8.0中,我有一个s文件,其中包含我编写的arm程序集代码块.我想调用这个asm函数并从我的Swift代码传递一个指针.我该怎么做呢?

以下是我在objective-c中做同样事情的方式:

void my_asm_function(int *myptr);   //this is prototype in my h-file

my_asm_function(&myIntVar);  // this is how i call the function from my obj-c code
Run Code Online (Sandbox Code Playgroud)

Wag*_*ota 5

只需像任何其他 C 函数一样调用您的函数......这样的事情应该可以帮助您直截了当: 如何从 Swift 调用 C?