ChallengesRISC-V
Local progress
All challengesRISC-VIntermediate25 min0 submissions
RISC-V challenge

Call a multiply function

Return 6 × 7 through a0 and print 42.

Complete multiply without changing main's call site. Follow the RV32 ABI: arguments and the return value use a0/a1 and ret returns through ra.

Learning goals

  • Call with JAL
  • Return through RA
  • Use the RV32M multiply instruction

Tests

  • Program exits cleanly
  • t0 preserves the returned 42
  • Terminal prints 42
  • Solution calls with JAL
  • Solution uses MUL
  • 1 hidden grading test

Hints

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