1
0

33 lines
676 B
Rust
Raw Normal View History

use crate::{Instruction, Operation};
2024-11-26 07:14:30 -05:00
pub struct Test {
pub operand_register: u8,
2024-11-28 05:36:10 -05:00
pub test_value: bool,
2024-11-26 07:14:30 -05:00
}
2025-01-08 04:21:01 -05:00
impl From<Instruction> for Test {
fn from(instruction: Instruction) -> Self {
let operand_register = instruction.b_field();
let test_value = instruction.c_field() != 0;
2024-12-08 08:01:15 -05:00
2024-11-26 07:14:30 -05:00
Test {
operand_register,
2024-12-08 08:01:15 -05:00
test_value,
2024-11-26 07:14:30 -05:00
}
}
}
impl From<Test> for Instruction {
fn from(test: Test) -> Self {
Instruction::new(
Operation::TEST,
0,
test.operand_register,
test.test_value as u8,
false,
false,
false,
)
2024-11-26 07:14:30 -05:00
}
}