.word的意思是什么?

来源:互联网 发布:photoshop中文版软件 编辑:程序博客网 时间:2024/06/02 09:51

看了点.word的分析,自己的理解。

http://www.lslnet.com/linux/dosc1/60/linux-395126.htm


比如说u-boot中的start.S中的:


ldr pc, _undefined_instruction


_undefined_instruction: .word undefined_instruction

指令LDR,它主要是用来从存储器(确切地说是地址空间)中装载数据到通用寄存器。

_undefined_instruction: 标号,在ARM汇编中Label会在连接时解释为一个常数,这里这个常数即undefined_instruction处的地址。

.word  伪指令    声明常量,在ARM中表示32位数

LDR取得undefined_instruction的值到PC,并跳转到undefined_instruction标号处继续执行。


而有时可以见到 诸如.long undefined_instruction ,表示跳转到undefined_instruction函数处执行。