# `uret`

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

**User-mode trap return**

Category: System

Returns from a user-mode interrupt or exception handler to the address in uepc.

Used in: [When an instruction cannot be carried out](https://asm-editor.specy.app/learn/courses/risc-v/talking-to-the-outside-world/exceptions.md) (RISC-V assembly)

## Forms

- `uret`

## Example

```riscv
# Set uepc to the address of after, providing the return destination normally saved by a user trap. uret resumes there; inspect t1=7 after the return.
.text
la t0, after
csrw t0, uepc
uret
after:
li t1, 7
```
