替代.string伪操作?

时间:2014-04-19 15:56:23

标签: macos assembly mach-o

我正在尝试在Mac OS X上运行使用.string伪操作的程序集文件,这显然是无法识别的。如何替换以下行,以便它可以在mac上运行?

ArrayIndexOutOfBoundsException:
.long 35
.string "Array index out of bounds exception"

我用来执行汇编文件的行是:

gcc -m32 -g3 runtime.c foo.s -o foo

runtime.c是一个文件,其中包含foo.s程序可以调用的函数。

1 个答案:

答案 0 :(得分:0)

.asciz,或者如果你没有ascii文本,那么手动添加一个终止0字节。

更新:如果您有.asciz,那么只需使用它代替.string

ArrayIndexOutOfBoundsException:
.long 35
.asciz "Array index out of bounds exception"

否则,如果您.ascii使用类似的内容:

ArrayIndexOutOfBoundsException:
.long 35
.ascii "Array index out of bounds exception"
.byte 0
相关问题