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

前端 未结 3 2079
既然无缘
既然无缘 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:53

    This helps GCC to distinguish between the operands and registers. operands have a single % as prefix. '%%' is always used with registers.

提交回复
热议问题