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

24 lines
554 B
Rust
Raw Normal View History

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