flat assembler
Message board for the users of flat assembler.

Index > Main > label with a colon question

Author
Thread Post new topic Reply to topic
MajorDill



Joined: 01 Nov 2010
Posts: 22
MajorDill 12 Oct 2016, 19:33
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: 20445
Location: In your JS exploiting you and your system
revolution 12 Oct 2016, 19:48
There is a difference. Without a colon the label will be tagged with the data size.
Code:
my_area1 db 12 dup 0
my_area2: times 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: 53
jorido 23 Jan 2017, 18:27
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: 257
Trinitek 23 Jan 2017, 19:30
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: 507
Location: New Zealand
neville 24 Jan 2017, 04:29
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: 20445
Location: In your JS exploiting you and your system
revolution 24 Jan 2017, 04:44
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


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.