# `ecall`

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

**Environment call (system call)**

Category: System

Executes the system call specified by the value in a7.

[RISC-V manual: ecall](https://docs.riscv.org/reference/isa/v20260120/unpriv/rv32.html#norm:ecall_op1)

Used in: [ecall](https://asm-editor.specy.app/learn/courses/risc-v/talking-to-the-outside-world/ecall.md) (RISC-V assembly), [The bitmap display and the keyboard registers](https://asm-editor.specy.app/learn/courses/risc-v/talking-to-the-outside-world/the-bitmap-display-and-the-keyboard.md) (RISC-V assembly), [Print a formatted line](https://asm-editor.specy.app/learn/courses/risc-v/examples/hello-world.md) (RISC-V assembly), [Read two numbers and print their sum](https://asm-editor.specy.app/learn/courses/risc-v/examples/sum-of-two-numbers.md) (RISC-V assembly), [Print a nonnegative number in bases 2–36](https://asm-editor.specy.app/learn/courses/risc-v/examples/number-to-string.md) (RISC-V assembly), [Drawing shapes on the screen](https://asm-editor.specy.app/learn/courses/risc-v/examples/drawing-on-the-screen.md) (RISC-V assembly), [A bouncing ball](https://asm-editor.specy.app/learn/courses/risc-v/examples/bouncing-ball.md) (RISC-V assembly), [Move a square with the keyboard](https://asm-editor.specy.app/learn/courses/risc-v/examples/keyboard-control.md) (RISC-V assembly), [The snake game](https://asm-editor.specy.app/learn/courses/risc-v/examples/snake.md) (RISC-V assembly), [Flappy ASM](https://asm-editor.specy.app/learn/courses/risc-v/examples/flappy-asm.md) (RISC-V assembly)

## Forms

- `ecall`

## Example

```riscv
# Simulator service 1 prints the integer in a0. This ecall prints 42.
.text
li a7, 1
li a0, 42
ecall
```
