In MIPS, while using a jump instruction, we use a label.
again: nop
$j again
So when we reach the jump instruction, we use the label
Each label corresponds to a unique address in memory. So in your example, and in agreement with what you stated, if the nop
instruction exists at 0x00400000 then again
will correspond (not point--more on that in a second) to that same address.
Labels can exist in both the text and data segments. However, in your example the label is shown in the .text:
segment. So, it represent the address of an instruction as opposed to a variable.
Here's the important distinction:
Labels are a part of most ISAs to make writing assembly easier for humans. However, it's important to remember that assembly is not the final form of code. In other words, in the binary representation your label won't be much of a label anymore.
So, this is what will happen:
The assembler will recognize the memory address associated with each label's instruction. Let's keep our running example of 0x00400000. Then, in each jump instruction it will take this address and use it to replace the label in the opcode. Poof, no more labels and definitely no pointers (which would imply we would have another place in memory that is storing a memory address).
Of course, the memory address itself corresponds to a spot in the text segment in your example because it matches to an instruction.
Simply stated, labels exist to make our lives easier. However, once they're assembled they're converted to the actual memory address of the instruction/variable that they've labeled.