Labels in GCC inline assembly

后端 未结 2 1500
礼貌的吻别
礼貌的吻别 2020-11-27 03:02

In my ongoing experimentation with GCC inline assembly, I\'ve run into a new problem regarding labels and inlined code.

Consider the following simple jump:



        
2条回答
  •  借酒劲吻你
    2020-11-27 03:20

    A declaration of a local label is indeed a number followed by a colon. But a reference to a local label needs a suffix of f or b, depending on whether you want to look forwards or backwards - i.e. 1f refers to the next 1: label in the forwards direction.

    So declaring the label as 1: is correct; but to reference it, you need to say jmp 1f (because you are jumping forwards in this case).

提交回复
热议问题