Difference between .equ and .word in ARM Assembly?

后端 未结 4 379
再見小時候
再見小時候 2020-12-10 06:50

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

4条回答
  •  醉酒成梦
    2020-12-10 07:07

    .equ is like #define in C:

    #define bob 10
    .equ bob, 10
    

    .word is like unsigned int in C:

    unsigned int ted;
    ted: 
    .word 0
    

    Or initialized with a value:

    unsigned int alice = 42;
    alice:
    .word 42
    

提交回复
热议问题