Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly MIPS中.word和.eq的区别是什么?_Assembly_Mips - Fatal编程技术网

Assembly MIPS中.word和.eq的区别是什么?

Assembly MIPS中.word和.eq的区别是什么?,assembly,mips,Assembly,Mips,我认为两者的作用大致相同:变量声明和初始化。你能详细说明一下吗?。word分配空间并初始化数据.eq定义一个常量,但不为其分配任何空间 例如,你可能会说: one .equ 1 ; defines a constant called "one" counter: .word one ; allocates space and initializes it with the value 1 不同之处在于.eq指令在编译后的图像中不分配任何空间。与C类似,第一行类似于#定义一个1,第二行类似于字

我认为两者的作用大致相同:变量声明和初始化。你能详细说明一下吗?

。word
分配空间并初始化数据
.eq
定义一个常量,但不为其分配任何空间

例如,你可能会说:

one .equ 1  ; defines a constant called "one"
counter: .word one ; allocates space and initializes it with the value 1

不同之处在于
.eq
指令在编译后的图像中不分配任何空间。

与C类似,第一行类似于
#定义一个1
,第二行类似于
字计数器=1