flat assembler
Message board for the users of flat assembler.

Index > Main > is it possible to concatenate strings in INCLUDE directive?

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
hi! I'd like to do smth like this:
i have PARAMS.INC file that defines some variable, for example

FILENAME = 'one'

and in source code i want to do the following:

format binary

include 'params.inc'
include FILENAM+'.inc'

. . .

so that ONE.INC file will be included next, and if FILENAM = 'two', then TWO.INC will be included.

is it possible to do such a thing? thanks a lot
Post 21 Jul 2008, 19:51
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
Define symbolic variable this way:
Code:
FILE equ 'one'     

and include this way:
Code:
match name,FILE
{ include name#'.inc' }    
Post 21 Jul 2008, 20:48
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
thanks a lot, Tomasz!
fasm is No 1 in the Universe!!!
Post 21 Jul 2008, 22:12
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.