nasm labels

Programming, for all ages and all languages.
Post Reply
User avatar
scgtrp
Member
Member
Posts: 30
Joined: Sat Mar 28, 2009 7:32 pm

nasm labels

Post 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.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: nasm labels

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: nasm labels

Post by Combuster »

I rather tend to think that its warning that you may have mistyped an opcode (or macro name).
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply