I want to 开发者_如何学Cinclude some files in the parent or sub directory of my source files. Is it possible with NASM?
NASM has several ways how to include one file in another.
%include
directive:
Which works similar to #include
directive in C
, e.g. you can write relative paths like so %include "some_dir/awesome.asm"
. If you don't want to specify relative paths to your files every time in the source code, you can determinate include file search directories via -i option
After preprocessing the actual output can be seen using -E option.
- Pre-Include a File(quote from the docs):
NASM allows you to specify files to be pre-included into your source file, by the use of the
-p
option.
nasm myfile.asm -p myinc.inc
is equivalent to runningnasm myfile.asm
and placing the directive%include "myinc.inc"
at the start of the file.
精彩评论