Skip to content

Commit

Permalink
Implement mfhi
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmr1993 committed Dec 7, 2023
1 parent f55e846 commit 3e00a70
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion optimism/src/mips/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,13 @@ pub fn interpret_rtype<Env: InterpreterEnv>(env: &mut Env, instr: RTypeInstructi
env.set_next_instruction_pointer(next_instruction_pointer + Env::constant(4u32));
return;
}
RTypeInstruction::MoveFromHi => (),
RTypeInstruction::MoveFromHi => {
let hi = env.read_register(&Env::constant(REGISTER_HI as u32));
env.write_register(&rd, hi);
env.set_instruction_pointer(next_instruction_pointer.clone());
env.set_next_instruction_pointer(next_instruction_pointer + Env::constant(4u32));
return;
}
RTypeInstruction::MoveToHi => (),
RTypeInstruction::MoveFromLo => {
let lo = env.read_register(&Env::constant(REGISTER_LO as u32));
Expand Down

0 comments on commit 3e00a70

Please sign in to comment.