1
0
dust/dust-lang/src/instruction/load_self.rs

20 lines
422 B
Rust
Raw Normal View History

2024-11-26 07:14:30 -05:00
use crate::{Instruction, Operation};
pub struct LoadSelf {
pub destination: u16,
}
impl From<&Instruction> for LoadSelf {
fn from(instruction: &Instruction) -> Self {
LoadSelf {
destination: instruction.a(),
}
}
}
impl From<LoadSelf> for Instruction {
fn from(load_self: LoadSelf) -> Self {
*Instruction::new(Operation::LoadSelf).set_a(load_self.destination)
}
}