创建和X code。使用汇编程序库 [英] Creating and using assembler library in xcode

查看:140
本文介绍了创建和X code。使用汇编程序库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前universisty我有汇编程序设计项目,以创建高层次的编程应用程序,它会使用一些汇编code作为一种外部库。

At universisty I have assembler programming project to create high-level programming application, which will use some assembler code as an external library.

所以,我在Objective-C /可可程序将加载图像,读取所有像素的颜色,然后通过这些颜色,以汇编程序/ code /库,这将使他们的一些操作,然后返回主OBJ-C再次程序。

So my program in Objective-C/Cocoa would load image, read all pixels colors and then pass those colors to assembler program/code/library which will make some operations on them and then return to main obj-c program again.

我知道,在Windows / Visual Studio中是很容易做到,能干,但因为我的工作在Mac上而已,我想这样做在Mac上。

I am aware that on Windows/Visual Studio it is easily do-able, but since I'm working on Mac only, I want to do it on Mac.

请给我一些指导。
谢谢!

Please give me some instructions. thanks!

达米安

推荐答案

通常的文件扩展名(从* nix中继承)的Mac OS X是.S,不.ASM。只需将它添加到你的X code项目,以及X code懂得如何建立和放大器;与图书馆联系起来。

The usual file name extension (inherited from *nix) for Mac OS X is .s, not .asm. Just add it to your Xcode project, and Xcode knows how to build & link it with your library.

乌利Kusterer的教程是一个很好的开始,以与编写汇编X code - 尽管意见笨拙包裹

Uli Kusterer's tutorial is a nice start to writing assembler with Xcode - although the comments are awkwardly wrapped.

(更新)要处理来自传递的参数和返回值到C或Objective-C code,你的汇编函数必须遵循<一个href=\"http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/LowLevelABI/000-Introduction/introduction.html\"相对=nofollow> Mac OS X的ABI ,其中详细的C函数如何使用堆栈帧和寄存器。

(Update) To handle arguments passed from and return values to C or Objective-C code, your assembler function must follow the Mac OS X ABI, which details how C functions use the stack frame and registers.

这篇关于创建和X code。使用汇编程序库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆