flat assembler
Message board for the users of flat assembler.

Index > Main > [FASM1] Calculating the number of generated bytes

Author
Thread Post new topic Reply to topic
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 01 Dec 2019, 17:29
Suppose we have code that goes like this:
Code:
Start:
        db 5

        org 1000
        db 10
End:    
How can we find out how many bytes are generated between Start and End labels? End - Start will obviously not work returning 1001 instead of 2.
Post 01 Dec 2019, 17:29
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 01 Dec 2019, 17:36
The way formatter in fasm 1 works, it is not possible to provide a symbol like fasmg's $%, at least not in general. It could be possible to implement it only for "format binary", but not for the other ones.

Therefore the only available option at the moment it to override ORG with macro and keep track of all addressing space changes. Or switch to fasmg if this is viable.
Post 01 Dec 2019, 17:36
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 02 Dec 2019, 10:50
maybe there, as you know what to count, you can take into account the org you defined.

Code:
somewhere=1000
Start:
db 5

org somewhere
db 10
End:

count = End-Start-somewhere
    
Post 02 Dec 2019, 10:50
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.