Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Xcode 6.1.1上的GNU汇编程序中重复指令?_Xcode_Assembly_Gnu Assembler - Fatal编程技术网

如何在Xcode 6.1.1上的GNU汇编程序中重复指令?

如何在Xcode 6.1.1上的GNU汇编程序中重复指令?,xcode,assembly,gnu-assembler,Xcode,Assembly,Gnu Assembler,我正在尝试使用Xcode6.1.1(我想是GNU汇编程序)编译一段代码,目标是iPadAir2(aarch64) 但上面的代码编译失败。我意识到“我”是符号而不是值,我找到了“.irp符号,值”,并写了一个新版本 .macro saving_callee_prsv_regi_2 used_regi_index .if \used_regi_index >= 19 i = 19 .rept \used_regi_index - 19

我正在尝试使用Xcode6.1.1(我想是GNU汇编程序)编译一段代码,目标是iPadAir2(aarch64)

但上面的代码编译失败。我意识到“我”是符号而不是值,我找到了“.irp符号,值”,并写了一个新版本

    .macro saving_callee_prsv_regi_2 used_regi_index
      .if \used_regi_index >= 19
        i = 19
        .rept \used_regi_index - 19
          .irp idx, i // fail here, "i" is expression not value?!
          str x\idx,[sp,#-8*(\idx-18)]
          i = i + 1
        .endr
       .endif      
    .endm
虽然新代码仍然无法通过编译,但我的预期结果是:

保存被调用方时\u prsv\u regi 19-->

保存被调用方时\u prsv\u regi 22-->


有什么建议吗?谢谢

GNU汇编程序主要是作为C编译器的后端开发的,因此它缺乏适合人类的功能。我能想到的最好的办法是:

。宏保存\u被调用方\u prsv\u regi使用的\u regi\u索引
.irp i、19、20、21、22、23、24、25、26、27、28、29、30、31

.如果\我感谢你的回答,它会起作用的!而在aarch64 ABI中,只有r19~r28是被调用方保存的寄存器,r29:FP r30:LR r31:stack寄存器,我担心保存它们可能不是被调用方的工作。我误解了什么吗?
    .macro saving_callee_prsv_regi_2 used_regi_index
      .if \used_regi_index >= 19
        i = 19
        .rept \used_regi_index - 19
          .irp idx, i // fail here, "i" is expression not value?!
          str x\idx,[sp,#-8*(\idx-18)]
          i = i + 1
        .endr
       .endif      
    .endm
    str x19,[sp,#-8]
    str x19,[sp,#-8]
    str x20,[sp,#-16]
    str x21,[sp,#-24]
    str x22,[sp,#-32]