开发者

NASM - Relative Include Files

开发者 https://www.devze.com 2023-03-11 22:09 出处:网络
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.

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.

  1. %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.

  1. 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 running nasm myfile.asm and placing the directive %include "myinc.inc" at the start of the file.

0

精彩评论

暂无评论...
验证码 换一张
取 消