Implement BLTU

This commit is contained in:
2025-12-22 21:17:38 +01:00
parent be1b1b9fe6
commit 2b5eb96187
2 changed files with 11 additions and 0 deletions

View File

@@ -132,3 +132,13 @@ pub fn bgeu(core: &mut Core, instr: Instruction) -> InstructionResult {
InstructionResult::Normal
}
pub fn bltu(core: &mut Core, instr: Instruction) -> InstructionResult {
if core.reg_read(instr.rs1()) < core.reg_read(instr.rs2()) {
core.pc = core.pc.wrapping_add(instr.imm_b());
} else {
core.advance_pc();
}
InstructionResult::Normal
}