fix(interpreter): set flags correctly for shifts

This commit is contained in:
2025-07-02 17:09:43 +09:00
parent 3ce0a461ca
commit f6447df90e
3 changed files with 81 additions and 33 deletions

View File

@@ -282,10 +282,10 @@ impl Shl for ImmediateOperand {
}
}
impl Shl<u8> for ImmediateOperand {
impl Shl<Word> for ImmediateOperand {
type Output = Self;
fn shl(self, rhs: u8) -> Self::Output {
fn shl(self, rhs: Word) -> Self::Output {
match self {
Self::Byte(b) => Self::Byte(b << rhs),
Self::Word(w) => Self::Word(w << rhs),
@@ -310,10 +310,10 @@ impl Shr for ImmediateOperand {
}
}
impl Shr<u8> for ImmediateOperand {
impl Shr<Word> for ImmediateOperand {
type Output = Self;
fn shr(self, rhs: u8) -> Self::Output {
fn shr(self, rhs: Word) -> Self::Output {
match self {
Self::Byte(b) => Self::Byte(b >> rhs),
Self::Word(w) => Self::Word(w >> rhs),