What does a double-percent sign (%%) do in gcc inline assembly?

前端 未结 3 2078
既然无缘
既然无缘 2021-01-04 11:17

I came across a code that looks like this:

asm volatile (
    # [...]
    \"movl $1200, %%ecx;\"
    # [...]
);

I know what movl $120

3条回答
  •  心在旅途
    2021-01-04 11:37

    GCC inline assembly uses %0, %1, %2, etc. to refer to input and output operands. That means you need to use two %% for real registers.

    Check this howto for great information.

提交回复
热议问题