use crate::{
Context,
vm::opcode::{Operation, VaryingOperand},
};
#[derive(Debug, Clone, Copy)]
pub(crate) struct LogicalNot;
impl LogicalNot {
#[inline(always)]
pub(crate) fn operation(value: VaryingOperand, context: &mut Context) {
context.vm.set_register(
value.into(),
(!context.vm.get_register(value.into()).to_boolean()).into(),
);
}
}
impl Operation for LogicalNot {
const NAME: &'static str = "LogicalNot";
const INSTRUCTION: &'static str = "INST - LogicalNot";
const COST: u8 = 1;
}