Segfault on movq instruction?

和自甴很熟 提交于 2019-11-29 16:45:05
merlin2011

It turns out that it has been too long since I have written asm, and I had forgotten that one must preface immediate values with $ in AT&T syntax. I found the reminder here when double-checking AT&T syntax.

asm("movq $100000000, %rcx;"
        "startofloop: ; "
        "sub $0x1, %rcx; "
        "jne startofloop; ");

movq 0x5F5E100, %rcx (without a $ on the number) is a load from the absolute address 0x5F5E100

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!