flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > label with a colon question

Author
Thread Post new topic Reply to topic
MajorDill



Joined: 01 Nov 2010
Posts: 16
label with a colon question
This is probable a stupid question but I'll ask it anyway

Is there a difference between a label with a colon and one without

my_area: times 12 db 0

- and -

my_area db 12 dup 0

If read the text file (fasm.txt) but I'm still not very clear.
Post 12 Oct 2016, 19:33
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14672
Location: Origae-6
There is a difference. Without a colon the label will be tagged with the data size.

Code:
my_area1 db 12 dup 0
my_area2times 12 db 0
mov eax,[my_area1;<--- size not matched, cannot assemble
mov eax,[my_area2;<--- no size check done, will assemble

Post 12 Oct 2016, 19:48
View user's profile Send private message Visit poster's website Reply with quote
jorido



Joined: 23 Jan 2017
Posts: 35
which is more common or recommended?
Post 23 Jan 2017, 18:27
View user's profile Send private message Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 254

jorido wrote:
which is more common or recommended?

Most of the time, I would think that you would want size checking, but it depends on what you want to accomplish.
Post 23 Jan 2017, 19:30
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 501
Location: New Zealand

jorido wrote:
which is more common or recommended?

Welcome! I prefer no size checking because it gives maximum flexibilty. But I just have to be more careful to be sure that I'm always getting want I intended (if I deliberately mismatch the data widths).

_________________
FAMOS - the first memory operating system
Post 24 Jan 2017, 04:29
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14672
Location: Origae-6
For me I prefer size checking. And when I need to access with a different size I use the size overrides. This way I know when I am accessing at a different size than what it was declared for.
Post 24 Jan 2017, 04:44
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.