flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > include and fix

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1794
Roman 22 Jul 2016, 10:30
I have directory: 'Block' and 'Block2'

And i want to do something like this:
Code:
DirA EQU 'Block\'
DirB EQU 'Block2\'
include DirA#'init_A.asm'
include DirB#'init_A.asm'
    
Post 22 Jul 2016, 10:30
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 22 Jul 2016, 16:46
include directive supports only quoted string as param

method 1:

make.bat:
Code:
fasm source.asm
    


source.asm:
Code:
include "Block\init_A.asm"
include "Block2\init_A.asm"
    


you can use environment

method 2:

make.bat:
Code:
set DirA=Block
set DirB=Block2
fasm source.asm
    


source.asm:
Code:
include "%DirA%\init_A.asm"
include "%DirB%\init_A.asm"
    


method 3:

make.bat:
Code:
set INCLUDE=Block;Block2
fasm source.asm
    


source.asm:
Code:
include "init_A.asm"
include "init_B.asm"
    


method 4:
source.asm:
Code:
DirA fix "Block\init_A.asm"
DirB fix "Block2\init_A.asm"

include DirA
include DirB
    

_________________
smaller is better
Post 22 Jul 2016, 16:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20342
Location: In your JS exploiting you and your system
revolution 22 Jul 2016, 19:25
method 5, use the match luke:
Code:
DirA EQU 'Block\'
DirB EQU 'Block2\'
match d,DirA{include d#'init_A.asm'}
match d,DirB{include d#'init_A.asm'}    
Post 22 Jul 2016, 19:25
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.