flat assembler
Message board for the users of flat assembler.

Index > Main > [fasmg] How to declare a "::" label with calculated address?

Author
Thread Post new topic Reply to topic
VEG



Joined: 06 Feb 2013
Posts: 80
VEG 02 May 2017, 20:22
How to declare a special "::" label with calculated address? Sometimes it is convenient do something like this:

Code:
virtual at 0

pelbl.src::

        file filename
        filesize = $

        ; Parse data here and add some additional external labels
                
end virtual    


I've tried something like this:
pelbl.hdr := pelbl.src + 0x40

But it doesn't work. It was planned to use like this:
load test:2 from pelbl.hdr:0

Is it possible to do somehow? It would be convenient for reading some structures from this file.
Post 02 May 2017, 20:22
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 02 May 2017, 20:46
The addressing space need to be specified through its own symbol. You can however try something like this:
Code:
label pelbl.hdr at 40h
pelbl.hdr.area equ pelbl.src    
to be able to access it this way:
Code:
load test:2 from pelbl.hdr.area : pelbl.hdr     

Or something even simpler:
Code:
pelbl.hdr equ pelbl.src : 40h
load test:2 from pelbl.hdr    
Post 02 May 2017, 20:46
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.