ARM汇编中.equ和.word的区别? [英] Difference between .equ and .word in ARM Assembly?

查看:27
本文介绍了ARM汇编中.equ和.word的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇 - 在定义常量时,ARM 汇编中的 .equ.word 指令有什么区别?

I am curious - What is the difference between .equ and .word directives in ARM assembly, when defining constants?

推荐答案

.equ 就像 C 中的 #define:

#define bob 10
.equ bob, 10

.word 就像 C 中的 unsigned int:

unsigned int ted;
ted: 
.word 0

或者用一个值初始化:

unsigned int alice = 42;
alice:
.word 42

这篇关于ARM汇编中.equ和.word的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆