ft(interpreter): impl all low-hanging fruit instructions
This commit is contained in:
@@ -7,7 +7,7 @@ use crate::register::SegmentRegister;
|
||||
|
||||
use crate::{disasm::DisasmError, register::Register};
|
||||
use core::fmt;
|
||||
use std::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Sub};
|
||||
use std::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Not, Sub};
|
||||
|
||||
pub type Byte = u8; // b
|
||||
pub type IByte = i8; // used for displacements of memory access
|
||||
@@ -334,6 +334,17 @@ impl BitXor for ImmediateOperand {
|
||||
}
|
||||
}
|
||||
|
||||
impl Not for ImmediateOperand {
|
||||
type Output = Self;
|
||||
|
||||
fn not(self) -> Self::Output {
|
||||
match self {
|
||||
ImmediateOperand::Byte(b) => ImmediateOperand::Byte(!b),
|
||||
ImmediateOperand::Word(w) => ImmediateOperand::Word(!w),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for ImmediateOperand {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user