Implement DIV
This commit is contained in:
@@ -6,4 +6,11 @@
|
||||
//
|
||||
use crate::{core::Core, decode::Instruction, exceptions::Exception};
|
||||
|
||||
// multiplication
|
||||
instr_op_r!(mul, u64::wrapping_mul);
|
||||
|
||||
// division
|
||||
instr_op_r!(div, |a, b| match b {
|
||||
0 => -1,
|
||||
_ => i64::wrapping_div(a as i64, b as i64),
|
||||
} as u64);
|
||||
|
||||
Reference in New Issue
Block a user