# `lr.w`

[RISC-V Documentation](https://asm-editor.specy.app/documentation/risc-v.md) › [Instructions](https://asm-editor.specy.app/documentation/risc-v/instruction.md)

Web page: https://asm-editor.specy.app/documentation/risc-v/instruction/lr.w

**Load reserved (word)**

Category: Atomic

Loads the word at the address in the second register into the first and reserves that address for a following sc.w.

[RISC-V manual: lr.w](https://docs.riscv.org/reference/isa/v20260120/unpriv/a-st-ext.html#norm:lr_w_op)

## Forms

- `lr.w t1, (t2)`

## Operands

- `t1`: Any integer register, `x0` to `x31`, or its named alias, such as `zero`, `t0` or `t6`.
- `t2`: An integer register. It may be the same register as `t1`.

## Description

Pair with sc.w to build an atomic read-modify-write that can be retried

## Example

```riscv
# value is initialized and naturally aligned for this operation.
.data
value: .word 0x12345678
.text
la t0, value
# Reserve the aligned word at value; t2 receives 305419896.
lr.w t2, (t0)
```
