From 5873e553e908c986d2f94e2e9b4756ac70b95577 Mon Sep 17 00:00:00 2001 From: Connor Wood Date: Sat, 22 Jul 2017 12:56:53 +0100 Subject: [PATCH] Implemented toDecimalString --- src/acpi/aml/type2opcode.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/acpi/aml/type2opcode.rs b/src/acpi/aml/type2opcode.rs index b0eb793..f4aa8bc 100644 --- a/src/acpi/aml/type2opcode.rs +++ b/src/acpi/aml/type2opcode.rs @@ -646,16 +646,19 @@ fn parse_def_to_decimal_string(data: &[u8], len: 0 as usize }) } - - // TODO: Compute the result - // TODO: Store the result, if appropriate + parser_opcode!(data, 0x97); let operand = parse_term_arg(&data[2..], ctx)?; let target = parse_target(&data[2 + operand.len..], ctx)?; + let result: String = format!("{}", operand.val.get_as_integer()?); + let res = AmlValue::String(result); + + ctx.modify(target.val, res.clone()); + Ok(AmlParseType { - val: AmlValue::Uninitialized, + val: res, len: 1 + operand.len + target.len }) }