flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > assigning areas in memory

Author
Thread Post new topic Reply to topic
Azagaros



Joined: 18 Jan 2013
Posts: 26
Azagaros 15 Jul 2017, 17:48
NASM has a keyword called "Absolute." The idea is to alias a piece of memory with a identifier.

Code:
absolute 0400h  
serialbase resw 4
    


Does fasm have something similar? I was not finding it in docs.
Post 15 Jul 2017, 17:48
View user's profile Send private message ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 15 Jul 2017, 18:02
You can use either ORG or VIRTUAL for this purpose. ORG simply changes the assumed address for assembled code or data:
Code:
org 0400h
serialbase rw 4    
And VIRTUAL does a similar thing for an enclosed block of instructions/definitions, but the difference is that any data generated this way does not go into output:
Code:
virtual at 0400h
    serialbase rw 4
end virtual    
Post 15 Jul 2017, 18:02
View user's profile Send private message Visit poster's website Reply with quote
Azagaros



Joined: 18 Jan 2013
Posts: 26
Azagaros 15 Jul 2017, 18:04
Cool thank you.
Post 15 Jul 2017, 18:04
View user's profile Send private message ICQ Number 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.