diff --git a/src/vm.cpp b/src/vm.cpp index cd7c884..313b7bc 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -263,6 +263,13 @@ void VM::step() { } else { throw std::runtime_error("Unknown I-type instruction"); } + } else if (funct3 == 0x02) { // SLTI + setreg(rd, (static_cast(registers[rs1]) < + static_cast(imm)) + ? 0 + : 1); + } else if (funct3 == 0x03) { // SLTIU + setreg(rd, (registers[rs1] < static_cast(imm)) ? 1 : 0); } else { throw std::runtime_error("Unknown I-type instruction"); }