使用内联汇编使用数组

时间:2017-03-13 19:56:52

标签: xcode assembly x86

我正在使用Xcode 8.2.1,需要使用内联汇编来处理数组。这是我的代码:

int mas[3][3];     //my array
asm finit
asm {

    xor esi, esi         //esi = 0

    mov ax, mas[esi]     //trying to put the first element in ax

}
asm fwait

当我运行我的程序时,Xcode会在mov ax, mas[esi]之间说出以下内容:

  

不能使用带有变量引用的基址寄存器。

但如果我写mov ax, mas[0]“,一切正常 那么,我该如何解决这个问题呢?

我的编译器: Apple LLVM 8.0.0版(clang-800.0.42.1)

0 个答案:

没有答案