Skip to content

Commit bce6e52

Browse files
alnyanIsaacWoods
authored andcommitted
aml: Implement DefLNot opcode
1 parent 37ee652 commit bce6e52

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

aml/src/expression.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ where
5353
def_l_not_equal(),
5454
def_l_and(),
5555
def_l_or(),
56+
def_l_not(),
5657
def_mid(),
5758
def_object_type(),
5859
def_package(),
@@ -404,6 +405,26 @@ where
404405
.map(|((), result)| Ok(result))
405406
}
406407

408+
fn def_l_not<'a, 'c>() -> impl Parser<'a, 'c, AmlValue>
409+
where
410+
'c: 'a,
411+
{
412+
/*
413+
* DefLNot := 0x92 Operand
414+
* Operand := TermArg => Integer
415+
*/
416+
opcode(opcode::DEF_L_NOT_OP)
417+
.then(comment_scope(
418+
DebugVerbosity::AllScopes,
419+
"DefLNot",
420+
term_arg().map_with_context(|arg, context| {
421+
let operand = try_with_context!(context, arg.as_bool());
422+
(Ok(AmlValue::Boolean(operand)), context)
423+
}),
424+
))
425+
.map(|((), result)| Ok(result))
426+
}
427+
407428
fn def_l_equal<'a, 'c>() -> impl Parser<'a, 'c, AmlValue>
408429
where
409430
'c: 'a,

0 commit comments

Comments
 (0)