# `pref`

[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/pref

**Prefetch**

Category: Load and store

Hints that the data at the address in a register plus an offset will be needed soon, so the hardware can begin moving it into cache.

## Forms

- `pref imm5, imm16($t2)`

## Operands

- `imm5`: An unsigned 5-bit immediate, `0` to `31`, used for values such as a shift count.
- `imm16`: A signed 16-bit immediate, `-32768` to `32767`.
- `$t2`: Any general-purpose register, `$0` to `$31`, using its numeric or named spelling, such as `$8` or `$t0` (`$zero` is `$0`; `$ra` is `$31`).

## Description

The first operand is the hint type. A prefetch is only ever a hint and never changes what a program computes; this simulator has no cache, so it does nothing. It is accepted so that compiler output assembles unchanged.

## Example

```mips
.data
.align 2
value: .word 42
.text
# Provide a valid address as a prefetch hint; inspect memory value remains 42.
la $t0, value
pref 0, 0($t0)
```
