diff options
| author | taitep <taitep@taitep.se> | 2025-12-30 17:27:42 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-30 17:27:42 +0100 |
| commit | 6a0e5e63c13c4cb480233106d2043f2706bd5183 (patch) | |
| tree | 2116389facfeca734e86b6ce9ed87998449f2467 /src/instructions/rvm.rs | |
| parent | e5c531256689883ac37549b3b9b15c4bd4b003ff (diff) | |
Implement DIV
Diffstat (limited to 'src/instructions/rvm.rs')
| -rw-r--r-- | src/instructions/rvm.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/instructions/rvm.rs b/src/instructions/rvm.rs index 475fc58..bd0c100 100644 --- a/src/instructions/rvm.rs +++ b/src/instructions/rvm.rs @@ -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); |
