Yes, your assumptions are correct. There are various types of movements that the assembler throws into the instruction, depending on the type. This is usually the offset to be added. You can use objdump -dr to view movements. For a better illustration, I changed the code a bit:
.data .int 0 TEXT: .asciiz "Foo" .text .global main main: li $t0, 1 beq $t0, 1, equal
Objdump output:
00000000 <main>: 0: 24080001 li t0,1 4: 24010001 li at,1 8: 11010004 beq t0,at,1c <equal> c: 00000000 nop 10: 2401002a li at,42 14: 1501ffff bne t0,at,14 <main+0x14> 14: R_MIPS_PC16 foo 18: 00000000 nop 0000001c <equal>: 1c: 3c040000 lui a0,0x0 1c: R_MIPS_HI16 .data 20: 0c000000 jal 0 <main> 20: R_MIPS_26 printf 24: 24840004 addiu a0,a0,4 24: R_MIPS_LO16 .data
As you said, there is no move for beq , since this is the relative address in this object file.
The added bne (line labeled C ) refers to an external character, so although the address is relative, a move record is required. It will be of type R_MIPS_PC16 to create a 16-bit dictionary offset of the word with the symbol foo . Since the encoding of the command requires an offset from the next word, and not the current PC that uses redistribution, 1 should be subtracted and encoded as 2 ffff additions in the instruction itself.
The pseudo-instruction la was translated by the assembler into the lui / addiu (the latter in the jal delay slot). For lui a R_MIPS_HI16 movement is created in the .data section, which fills the upper 16 bits. Since the TEXT character is at address 4 in the .data section, the upper 16 bits of the offset are 0 . This means that the instruction contains an offset of 0 . Similarly, for the lower 16 bits, except there, the instruction contains an offset of 4 .
Finally, jal printf uses another kind of move, which is for the coding required by the instruction. The offset is zero, because the transition is made directly to the specified character. Note that objdump tries to be useful by decrypting this, but it does not handle the move, so the <main> output is, of course, pointless.