Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does label: .word label mean in ARM Assembly

Tags:

assembly

arm

I am looking at the following sequence in uboot

.globl _start
_start: b   reset
    ldr pc, _undefined_instruction
    ldr pc, _software_interrupt
    ldr pc, _prefetch_abort
    ldr pc, _data_abort
    ldr pc, _not_used
    ldr pc, _irq
    ldr pc, _fiq
#ifdef CONFIG_SPL_BUILD
_undefined_instruction: .word _undefined_instruction
_software_interrupt:    .word _software_interrupt
_prefetch_abort:    .word _prefetch_abort
_data_abort:        .word _data_abort
_not_used:      .word _not_used
_irq:           .word _irq
_fiq:           .word _fiq
_pad:           .word 0x12345678 /* now 16*4=64 */
#else
_undefined_instruction: .word undefined_instruction
_software_interrupt:    .word software_interrupt
_prefetch_abort:    .word prefetch_abort
_data_abort:        .word data_abort
_not_used:      .word not_used
_irq:           .word irq
_fiq:           .word fiq
_pad:           .word 0x12345678 /* now 16*4=64 */
#endif  /* CONFIG_SPL_BUILD */

Now if there is an IRQ or a FIQ core will branch to _irq, but in one case it find _irq : .word _irq, What does this mean ?

Is the address of _irq a valid instruction in ARM ? I am not able to understand this, can anyone explain ?

like image 430
user970251 Avatar asked Sep 17 '13 11:09

user970251


1 Answers

label: .word value places the 4-byte value at the address assigned (by the linker) to label.

So _irq: .word _irq effectively places _irq's address at that address (e.g. if the address of the _irq label is 0x12345678 you'd get the value 0x12345678 at address 0x12345678).

like image 111
Michael Avatar answered Oct 05 '22 02:10

Michael