flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > A memory data size checking

Author
Thread Post new topic Reply to topic
Moveton



Joined: 24 Feb 2008
Posts: 2
Moveton 24 Feb 2008, 22:51
[quote=fasm roots]However in flat assembler every label, though being just address at the first sight, still keeps the information about what type of variable is defined behind it - and provides the size checking just like I had it with TASM[/quote]
So I've written the followng:
Code:
format COFF

public _app1Entry

        use32
section "XDATA" data
d1:
        dw ?

section "XCODE" code
_app1Entry:
        mov [d1], ebx
        ret
    

assuming to got an error but last fasm takes it without questions and even warnings. Should I activate the size checking by some special way?
Post 24 Feb 2008, 22:51
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20416
Location: In your JS exploiting you and your system
revolution 24 Feb 2008, 22:59
You can't use the colon (:) if you want size checking:
Code:
section "XDATA" data
d1        dw ? 
...    
Post 24 Feb 2008, 22:59
View user's profile Send private message Visit poster's website Reply with quote
Moveton



Joined: 24 Feb 2008
Posts: 2
Moveton 24 Feb 2008, 23:59
So with colon this will be not data label. Understand but seems as not intuitive. It will be fine to be documented somewhere.
Post 24 Feb 2008, 23:59
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4352
Location: Now
edfed 25 Feb 2008, 00:28
it is documented
but it's to the reader to understand the text.


http://flatassembler.net/docs.php?article=manual#1.2.3
Quote:

There are different ways to define labels. The simplest is to follow the name of label by the colon, this directive can even be followed by the other instruction in the same line. It defines the label whose value is equal to offset of the point where it's defined. This method is usually used to label the places in code. The other way is to follow the name of label (without a colon) by some data directive. It defines the label with value equal to offset of the beginning of defined data, and remembered as a label for data with cell size as specified for that data directive in table 1.3.
Post 25 Feb 2008, 00:28
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.