ChallengesRISC-V
Local progress
All challengesBeginner10 min0 submissions
RISC-V challenge

Add two values

Add 5 and 7 and leave 12 in t2.

Use RV32 registers and an ADD instruction to combine the two supplied values before exiting.

Learning goals

  • Load immediate values
  • Use a three-register ADD
  • Inspect the destination register

Tests

  • Program exits cleanly
  • t2 contains 12
  • Solution uses ADD
  • 1 hidden grading test

Hints

riscv-add-two-values.sRISC-V source
Run the visible tests or submit when you are ready.