summaryrefslogtreecommitdiff
path: root/src/decode.rs
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-27 21:47:22 +0100
committertaitep <taitep@taitep.se>2025-12-27 21:47:22 +0100
commit8024af6b1348b5f47fabe5a1949de54607a33888 (patch)
tree4b9cbf86d2adc23eeb77eb8ed6c2d24ba7d57b32 /src/decode.rs
parent5c008bfc0446e4631dbab64be61159af04f78dd1 (diff)
Implement ECALL and EBREAK, the final RV64I instructions!
Diffstat (limited to 'src/decode.rs')
-rw-r--r--src/decode.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/decode.rs b/src/decode.rs
index d520151..e24bac0 100644
--- a/src/decode.rs
+++ b/src/decode.rs
@@ -93,4 +93,9 @@ impl Instruction {
pub fn funct6(self) -> u8 {
(self.0 >> 26 & 0x3f) as u8
}
+
+ /// Mostly/only used for the SYSTEM opcode
+ pub fn funct12(self) -> u16 {
+ (self.0 >> 20) as u16
+ }
}