# `amoand.d`

[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/amoand.d

**Atomic and double word (64-bit)** · RV64 only

Category: Atomic

Loads the double word at the address in the third register into the first and stores its bitwise AND with the second register back there, atomically.

[RISC-V manual: amoand.d](https://docs.riscv.org/reference/isa/v20260120/unpriv/a-st-ext.html#sec:amo)

## Forms

- `amoand.d t1, t2, (t3)`

## 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`.
- `t3`: An integer register. It may be the same register as `t1`.

## Description

Clears a bit mask in shared memory

## Example

```riscv64
# value is initialized and naturally aligned for this operation.
.data
value: .dword 0x0000000012345678
.text
la t0, value
# Atomic operation returns the old value 305419896 in t2, then changes value to 0.
li t1, 5
amoand.d t2, t1, (t0)
```
