Search code examples
nasm

NASM label or instruction expected at start of line


I had trying assembly a file. But it has some error. How can I fix it? Why it failed?

I had assembly the following code using nasm ipl.asm -o ipl.bin -l ipl.asm.lst:


; Omitted because it is not important.

error:  mov si, failmsg
    call putstr

bl: hlt
    jmp bl

; Omitted because it is not important, too.

(above ipl.asm)

but it failed with:

ipl.asm:80: error: label or instruction expected at start of line

How can I fix it? Why it fail?


Solution

  • (Copied from the comment of @ecm. Thank her.)

    bl is a register name, so we can't name a label using bl.