diff options
| author | taitep <taitep@taitep.se> | 2025-12-30 16:56:09 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-30 16:56:09 +0100 |
| commit | e5c531256689883ac37549b3b9b15c4bd4b003ff (patch) | |
| tree | afe837d6c7cf6ed797f6fc2b5b9a966dc83c64e8 /src | |
| parent | 9a9bef7dd7dce7d5c10b7cf49a42478ad85829ac (diff) | |
Implement MUL
Diffstat (limited to 'src')
| -rw-r--r-- | src/instructions.rs | 2 | ||||
| -rw-r--r-- | src/instructions/rvm.rs | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/instructions.rs b/src/instructions.rs index 2a2f6b0..d8e3ce2 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -8,6 +8,7 @@ mod macros; mod rvi; +mod rvm; use crate::{ core::Core, @@ -31,6 +32,7 @@ pub(crate) fn find_and_exec(instr: Instruction, core: &mut Core) -> Result<(), E // OP (0b000, 0b0000000) => rvi::add(core, instr), (0b000, 0b0100000) => rvi::sub(core, instr), + (0b000, 0b0000001) => rvm::mul(core, instr), (0b010, 0b0000000) => rvi::slt(core, instr), (0b011, 0b0000000) => rvi::sltu(core, instr), (0b001, 0b0000000) => rvi::sll(core, instr), diff --git a/src/instructions/rvm.rs b/src/instructions/rvm.rs new file mode 100644 index 0000000..475fc58 --- /dev/null +++ b/src/instructions/rvm.rs @@ -0,0 +1,9 @@ +// Copyright (c) 2025 taitep +// SPDX-License-Identifier: BSD-2-Clause +// +// This file is part of TRVE (https://gitea.taitep.se/taitep/trve) +// See LICENSE file in the project root for full license text. +// +use crate::{core::Core, decode::Instruction, exceptions::Exception}; + +instr_op_r!(mul, u64::wrapping_mul); |
