ft(interpreter): impl basic call

This commit is contained in:
2025-06-17 11:24:03 +09:00
parent 7e7e648fa8
commit 200640447b
3 changed files with 28 additions and 7 deletions

View File

@@ -110,6 +110,16 @@ impl From<Word> for ImmediateOperand {
}
}
impl From<usize> for ImmediateOperand {
fn from(value: usize) -> Self {
if value > Word::MAX as usize {
panic!("Cannot convert usize to ImmediateOperand::Word")
} else {
ImmediateOperand::Word(value as Word)
}
}
}
impl Into<Word> for ImmediateOperand {
fn into(self) -> u16 {
match self {