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

Sum 1 through 10

Build a counted RV32 loop and print 55.

Complete the loop so t2 accumulates 1 through 10. Keep the supplied environment calls for printing and exiting.

Learning goals

  • Use ABI register names
  • Control a loop with a branch
  • Pass an integer to ecall

Tests

  • Program exits cleanly
  • t2 contains 55
  • Terminal prints 55
  • Solution uses a BLE loop
  • 1 hidden grading test

Hints

riscv-sum-ten.sRISC-V source
Run the visible tests or submit when you are ready.