Implement BGEU
This commit is contained in:
@@ -122,3 +122,13 @@ pub fn bne(core: &mut Core, instr: Instruction) -> InstructionResult {
|
||||
|
||||
InstructionResult::Normal
|
||||
}
|
||||
|
||||
pub fn bgeu(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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user