flat assembler
Message board for the users of flat assembler.

Index > Main > File size calculating ("file" directive)

Author
Thread Post new topic Reply to topic
KostX



Joined: 19 Sep 2012
Posts: 41
KostX 12 Mar 2014, 22:43
Hi all! Very Happy I'm gonna include data from some file. I need to know, is it possable to calculate including file size before compilation?

Code:
section '.xdata' data readable writeable
     FileSize dd ?     ; Here needs to be the size of 'file.pgr'!!!
     file 'file.pgr'      ; This file includes normal
    
Post 12 Mar 2014, 22:43
View user's profile Send private message Reply with quote
KostX



Joined: 19 Sep 2012
Posts: 41
KostX 12 Mar 2014, 22:44
Do you know how to make it done or give me some links?
Post 12 Mar 2014, 22:44
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20486
Location: In your JS exploiting you and your system
revolution 12 Mar 2014, 22:45
Code:
FileSize dd file_size
file_begin: file 'file.pgr'
file_size = $-file_begin    
Post 12 Mar 2014, 22:45
View user's profile Send private message Visit poster's website Reply with quote
KostX



Joined: 19 Sep 2012
Posts: 41
KostX 12 Mar 2014, 22:47
Thanks Wink
Post 12 Mar 2014, 22:47
View user's profile Send private message 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.