Assembly (Intel syntax + NASM) Error: attempt to define a local label before any non-local labels

前端 未结 2 1316
伪装坚强ぢ
伪装坚强ぢ 2021-01-21 03:42

I am quite new regarding the assembly and I am trying to work with a program. So whenever I try to compile it, I get the error for the line, as listed under the comments in the

相关标签:
2条回答
  • 2021-01-21 03:54

    In NASM a label starting with dot is called a local label. It is appended to the last global label, for example,

    L:
    .l2: ; it is really L.l2
    

    So you cannot have a local label before any global ones

    0 讨论(0)
  • 2021-01-21 04:11

    That's not NASM code at all. As @Jester says, it's probably TASM or MASM.

    NASM doesn't ASSUME, so you can be 100% sure this is not NASM code.


    It's definitely not Linux code, either. Note the .286 directive. That means it will be 16-bit code. Even if you convert the syntax to NASM, the resulting binary will not do anything useful on your Linux system.

    (This question doesn't mention Linux, but the followup does).

    0 讨论(0)
提交回复
热议问题