【发布时间】:2017-01-20 07:14:09
【问题描述】:
我有两个文件,main.s 和 test.s,其中 test.s 看起来像这样:
test:
add a1,a2,a2
...而 main.s 看起来像这样:
main:
call test
(非常无意义的例子)。如何在 main 中包含测试?我正在使用这样的 gcc:
gcc -o main main.c
但我不知道如何在其中使用测试...有什么帮助吗?
【问题讨论】:
我有两个文件,main.s 和 test.s,其中 test.s 看起来像这样:
test:
add a1,a2,a2
...而 main.s 看起来像这样:
main:
call test
(非常无意义的例子)。如何在 main 中包含测试?我正在使用这样的 gcc:
gcc -o main main.c
但我不知道如何在其中使用测试...有什么帮助吗?
【问题讨论】:
您可以像在 GCC 中包含其他任何内容一样包含该文件:
#include"test.S"
如果您使用的是 NASM,您会使用:
%include "test.s"
【讨论】: