ecall
Environment call (system call)
Executes the system call specified by the value in a7.
Used in
- ecallRISC-V assembly
- The bitmap display and the keyboard registersRISC-V assembly
- Print a formatted lineRISC-V assembly
- Read two numbers and print their sumRISC-V assembly
- Print a nonnegative number in bases 2–36RISC-V assembly
- Drawing shapes on the screenRISC-V assembly
- A bouncing ballRISC-V assembly
- Move a square with the keyboardRISC-V assembly
- The snake gameRISC-V assembly
- Flappy birdRISC-V assembly
Forms
ecall
# Simulator service 1 prints the integer in a0. This ecall prints 42.
.text
li a7, 1
li a0, 42
ecall