NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: akasei on April 01, 2016, 07:10:36 AM

Title: %include file name in variable
Post by: akasei on April 01, 2016, 07:10:36 AM
Code: [Select]
%define VARIABLE_KERNEL_LOCALE "pl_PL"
%include "locale/", VARIABLE_KERNEL_LOCALE, ".asm"
How to do that?
Title: Re: %include file name in variable
Post by: Bryant Keller on April 03, 2016, 06:20:49 AM
use %defstr and %strcat.
Code: [Select]
%push
    %defstr %$VAR_KERN_LOCALE pl_PL
    %strcat %$myinc, "locale/", %$VAR_KERN_LOCALE, ".asm"
    %include %$myinc
%pop
Title: Re: %include file name in variable
Post by: akasei on April 04, 2016, 09:11:51 AM
Thank You very much!

config.asm
Code: [Select]
%define VARIABLE_KERNEL_LOCALE en_US.ASCII
kernel.asm
Code: [Select]
%include "config.asm"

%push
%defstr %$kernel_locale VARIABLE_KERNEL_LOCALE
%strcat %$include_kernel_locale, "locale/", %$kernel_locale, ".asm"
%$include %$include_kernel_locale
%pop