NASM/Yasm drops CALL after comment ending with backslash

后端 未结 1 1215
失恋的感觉
失恋的感觉 2021-01-25 09:01

I am currently trying to built my own boot loader and noticed something peculiar.

When below code is assembled with NASM or Yasm without the marked NOP command the follo

相关标签:
1条回答
  • 2021-01-25 09:08

    The backslash character, '\', as the last thing on a line, is Nasm's "line continuation character". By putting it in a comment, the comment is continued to the next line - commenting out the nop or call. (it is not the nature of nop to just disappear like that!). Lose it, or put something after it.

    – Frank Kotler


    From the NASM manual, 3.1 Layout of a NASM Source Line:

    NASM uses backslash (\) as the line continuation character; if a line ends with backslash, the next line is considered to be a part of the backslash-ended line.

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