Using base pointer register in C++ inline asm

前端 未结 2 1151
情话喂你
情话喂你 2020-11-22 04:29

I want to be able to use the base pointer register (%rbp) within inline asm. A toy example of this is like so:

void Foo(int &x)
{
    asm vo         


        
2条回答
  •  不要未来只要你来
    2020-11-22 04:42

    In x86-64, the stack pointer needs to be aligned to 8 bytes.

    This:

    subq $12, %rsp;      // make room
    

    should be:

    subq $16, %rsp;      // make room
    

提交回复
热议问题