# `la`

[MIPS Documentation](https://asm-editor.specy.app/documentation/mips.md) › [Instructions](https://asm-editor.specy.app/documentation/mips/instruction.md)

Web page: https://asm-editor.specy.app/documentation/mips/instruction/la

**Load address** · Pseudo-instruction

Category: Data movement

Puts the address of a label, or a computed address, into a register.

Used in: [.data, .text and directives](https://asm-editor.specy.app/learn/courses/mips/introduction/data-text-and-directives.md) (MIPS assembly), [Memory, little endian and alignment](https://asm-editor.specy.app/learn/courses/mips/introduction/memory-little-endian-and-alignment.md) (MIPS assembly), [Words, halves and bytes](https://asm-editor.specy.app/learn/courses/mips/introduction/words-halves-and-bytes.md) (MIPS assembly), [The MIPS instruction set](https://asm-editor.specy.app/learn/courses/mips/introduction/the-mips-instruction-set.md) (MIPS assembly), [Loads, stores and immediates](https://asm-editor.specy.app/learn/courses/mips/introduction/loads-stores-and-immediates.md) (MIPS assembly), [Memory regions and executable files](https://asm-editor.specy.app/learn/courses/mips/introduction/memory-regions-and-executable-files.md) (MIPS assembly), [Arrays and strings](https://asm-editor.specy.app/learn/courses/mips/think-in-assembly/arrays-and-strings.md) (MIPS assembly), [Floating point and Coprocessor 1](https://asm-editor.specy.app/learn/courses/mips/think-in-assembly/floating-point-and-coprocessor-1.md) (MIPS assembly), [syscall in the Playground](https://asm-editor.specy.app/learn/courses/mips/talking-to-the-outside-world/syscall.md) (MIPS assembly), [The bitmap display and keyboard registers](https://asm-editor.specy.app/learn/courses/mips/talking-to-the-outside-world/the-bitmap-display-and-the-keyboard.md) (MIPS assembly)

## Forms

- `la $t1, ($t2)`
  - `la $t1,($t2)` → `addi $t1, $t2, 0`
- `la $t1, imm`
  - `la $t1,-100`: Set $t1 to 16-bit immediate (sign-extended) → `addiu $t1, $zero, imm`
  - `la $t1,100`: Set $t1 to 16-bit immediate (zero-extended) → `ori $t1, $zero, imm`
  - `la $t1,100000`: Set $t1 to 32-bit immediate → `lui $at, hi(imm)`; `ori $t1, $at, lo(imm)`
- `la $t1, imm($t2)`
  - `la $t1,100($t2)`: Set $t1 to sum (of $t2 and 16-bit immediate) → `ori $at, $zero, imm`; `add $t1, $t2, $at`
  - `la $t1,100000($t2)`: Set $t1 to sum (of $t2 and 32-bit immediate) → `lui $at, hi(imm)`; `ori $at, $at, lo(imm)`; `add $t1, $t2, $at`

- `la $t1, label` · Set $t1 to label's address
  - `la $t1,label` → `lui $at, hi(label)`; `ori $t1, $at, lo(label)`

- `la $t1, label($t2)` · Set $t1 to sum (of $t2 and label's address)
  - `la $t1,label($t2)` → `lui $at, hi(label)`; `ori $at, $at, lo(label)`; `add $t1, $t2, $at`

- `la $t1, label+imm32` · Set $t1 to sum (of label's address and 32-bit immediate)
  - `la $t1,label+100000` → `lui $at, hi(label+imm32)`; `ori $t1, $at, lo(label+imm32)`

- `la $t1, label+imm32($t2)` · Set $t1 to sum (of label's address, 32-bit immediate, and $t2)
  - `la $t1,label+100000($t2)` → `lui $at, hi(label+imm32)`; `ori $at, $at, lo(label+imm32)`; `add $t1, $t2, $at`

## Operands

- `$t1`: Any general-purpose register, `$0` to `$31`, using its numeric or named spelling, such as `$8` or `$t0` (`$zero` is `$0`; `$ra` is `$31`).
- `$t2`: A general-purpose register. It may be the same register as `$t1`.
- `imm`: An immediate value: a signed 16-bit value (`-32768` to `32767`), an unsigned 16-bit value (`0` to `65535`) or a 32-bit value (`-2147483648` to `4294967295`). The size your value needs decides which real instructions the assembler uses. Open the row to see them for each size.
- `label`: A named address in the program, such as the start of a loop or a variable in `.data`.
- `imm32`: A 32-bit immediate, `-2147483648` to `4294967295`. A pseudo-instruction that takes one uses the register `$at` as a temporary, so `$at` loses the value it held.

## Example

```mips
.data
value: .word 42
.text
# Form value's address. Inspect $t0: the initialized data begins at 0x10010000.
la $t0, value
```
