flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > [fasmg] How to declare a "::" label with calculated address?

Author
Thread Post new topic Reply to topic
VEG



Joined: 06 Feb 2013
Posts: 67
Location: Minsk, Belarus
[fasmg] How to declare a "::" label with calculated address?
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
Assembly Artist


Joined: 16 Jun 2003
Posts: 6397
Location: Kraków, Poland
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.