Assembly ARM程序集:声明当前文件中任何位置可见的变量&;节目中

Assembly ARM程序集:声明当前文件中任何位置可见的变量&;节目中,assembly,static,arm,Assembly,Static,Arm,我的问题是在解决以下问题的过程中提出的: /* Write assembly code to declare variables equivalent to the following C code: */ /* these variables are declared outside of any function */ 1) static int foo[3]; /* visible anywhere in the current file */ 2) static char bar[

我的问题是在解决以下问题的过程中提出的:

/* Write assembly code to declare variables equivalent to the following C code: */

/* these variables are declared outside of any function */
1) static int foo[3];   /* visible anywhere in the current file */
2) static char bar[4];  /* visible anywhere in the current file */
3) char barfoo;         /* visible anywhere in the program */
4) int foobar;          /* visible anywhere in the program */
我的问题是:

如何声明程序中任何地方可见的变量?而且,它与声明当前文件中任何位置可见的变量有何不同?

到目前为止,我所取得的成就是:

1) foo:  .word  0,0,0,0
2) bar:  .char  0,0,0,0,0
3) 
4) 
但正如你所看到的,我对3号和4号有问题?如何做到这一点?当然,如果我对数字1和2有错误,请纠正我,因为很明显我是一个学习者:D

非常感谢

供参考:我的问题直接遵循的练习可以在第2章中找到


我使用的汇编程序是GAS。

使用
EXPORT
.GLOBAL
-汇编语言是特定于您使用的汇编程序的。你在用什么汇编程序?您还可以查看作为工具链一部分使用的编译器的输出,并查看它们如何将标签声明为全局的。