Implement a GDB stub and fix another huge issue in S-type immediate decoding

This commit is contained in:
2025-12-27 11:48:36 +01:00
parent a64fcaa3b5
commit 9f8e9ec380
9 changed files with 636 additions and 40 deletions

View File

@@ -57,7 +57,9 @@ impl Instruction {
#[inline]
pub fn imm_s(self) -> DWord {
(self.0 as i32 as i64 >> (25 - 5) & (0x7f << 5)) as DWord | (self.0 >> 7 & 0b11111) as DWord
let imm_11_5 = (self.0 as i32 as i64 >> 25 << 5) as DWord;
let imm_4_0 = (self.0 >> 7 & 0x1f) as DWord;
imm_11_5 | imm_4_0
}
#[inline]