Page 1 of 1

nasm labels

Posted: Mon May 25, 2009 11:40 am
by scgtrp
What is the difference between these?

Code: Select all

foo db 0

Code: Select all

foo: db 0
The only difference I can find is that NASM warns me if I have a label on a line by itself without a colon.

Re: nasm labels

Posted: Mon May 25, 2009 12:12 pm
by NickJohnson
I think the issue is that NASM will accept labels without colons, but wants you to use colons. It's probably just in case they want to add a feature that makes it necessary for labels to have colons and break the improperly written code.

Re: nasm labels

Posted: Mon May 25, 2009 12:56 pm
by Combuster
I rather tend to think that its warning that you may have mistyped an opcode (or macro name).