include - NASM - 相关包含文件

标签 include nasm assembly

我想在源文件的父目录或子目录中包含一些文件。 NASM 可以吗?

最佳答案

NASM 有多种方法将一个文件包含在另一个文件中。

  1. %include 指令:

其工作方式类似于C中的#include指令,例如您可以像 %include "some_dir/awesome.asm" 这样编写相对路径。如果您不想在源代码中每次都指定文件的相对路径,您可以通过 -i option 确定包含文件搜索目录。

预处理后,可以使用-E option看到实际输出.

  • 预包含文件(引自 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.

    关于include - NASM - 相关包含文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6292999/

    相关文章:

    用多个包含路径编译c语言

    c++ - 为什么我可以在多个包含const int的cpp文件中包含一个头文件而不会出现编译错误?

    PHP:需要路径不适用于 cron 作业?

    assembly - LC3 LEA 指令和存储的值

    将 ASM 转换为 C?

    c++ - 是否可以在 C++ 中以间接方式包含头文件

    linux - 自动运行终端命令的汇编代码

    c++ - 使用 NASM/Linux 的定时器

    assembly - 在 YASM 或 NASM 程序集中执行退格键

    c - 在 C++ 函数中执行汇编