
Assembly
Handle Traps in RISC-V Machine Mode With mtvec, mepc and mcause
Write a RISC-V machine-mode trap handler in assembly: set mtvec, save registers, decode mcause, advance mepc past ecall and return with mret.
7 min read
Tag
1 post

Write a RISC-V machine-mode trap handler in assembly: set mtvec, save registers, decode mcause, advance mepc past ecall and return with mret.