如何在macOS Sierra上运行x86 .asm

时间:2017-03-07 20:14:09

标签: macos assembly

我在macOS上编译.asm文件有问题可以帮助我吗?

这是我的存储库: https://github.com/ondrej-111/Asm.git

我尝试使用以下命令编译它:

  

nasm -f elf -d macho64 asm_io.asm

     

nasm -f elf prvy.asm

     

gcc -c driver.c

     

gcc -o prvy driver.o prvy.o asm_io.o

但我总是得到同样的错误:

  

ld:警告:ld:警告:忽略文件asm_io.o,文件是为其构建的   不支持的文件格式(0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00 0x00   0x00 0x00 0x00 0x00 0x00 0x00 0x00)这不是架构   被链接(x86_64):asm_io.oignoring文件prvy.o,文件已构建   对于不支持的文件格式(0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00   0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00)这不是   被链接的架构(x86_64):prvy.o

     

架构x86_64的未定义符号:“_ asm_main”,引用   从:         _main in driver.o ld:找不到架构x86_64 clang的符号:错误:链接器命令失败,退出代码为1(使用-v to   见调用)

我搜索了一些类似的问题但是任何人都帮我解决了。(我试过这个 - How can I run this assembly code on OS X?

0 个答案:

没有答案