Skip to content
  • Authors: Alejandro Calderón Mateos & Felix García Carballeira
  • License: GPLv3.0

Introduction to RISC-V assembly

Basic instructions (Google colab)

  • Load and copy instructions
  • li
  • mv
  • Arithmetic instructions
  • add, addi, sub
  • mul, div
  • rem
  • Logic instructions
  • or, ori
  • and, andi
  • xor, xori
  • Shift instructions
  • srl, sll
  • sra

Loops (Google colab)

Loop constructions translated into assembly: * FOR-like loop: x1 != 5 * FOR-like loop: x1 < 5 * FOR-like loop: x1 <= 5

If-Then(-Else) (Google colab)

If-Then/If-Then-Else constructions translated into assembly: * if-then (full assembly version) * if-then (compact assembly version) * if-then-else (compact assembly version)