27.10.2015 Views

Advanced Configuration and Power Interface Specification

ACPI_6.0

ACPI_6.0

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ACPI Source Language (ASL)Reference<br />

Example<br />

The following example creates the name CNT that references an integer data object with the value 5<br />

<strong>and</strong> then stores CNT to Local0. After the Store operation, Local0 is an integer object with the value<br />

5.<br />

Name (CNT, 5)<br />

Store (CNT, Local0)<br />

19.6.125 Subtract (Integer Subtract)<br />

Syntax<br />

Subtract (Minuend, Subtrahend, Result) => Integer<br />

Result = Minuend - Subtrahend => Integer<br />

Result -= Subtrahend => Integer<br />

Arguments<br />

Minuend <strong>and</strong> Subtrahend are evaluated as Integers.<br />

Description<br />

Subtrahend is subtracted from Minuend, <strong>and</strong> the result is optionally stored into Result. Underflow<br />

conditions are ignored <strong>and</strong> the result simply loses the most significant bits.<br />

19.6.126 Switch (Select Code To Execute Based On Expression)<br />

Syntax<br />

Switch (Expression) {CaseTermList}<br />

Arguments<br />

Expression is an ASL expression that evaluates to an Integer, String or Buffer.<br />

Description<br />

The Switch, Case <strong>and</strong> Default statements help simplify the creation of conditional <strong>and</strong> branching<br />

code. The Switch statement transfers control to a statement within the enclosed body of executable<br />

ASL code<br />

If the Case Value is an Integer, Buffer or String, then control passes to the statement that matches the<br />

value of Switch (Expression). If the Case value is a Package, then control passes if any member of<br />

the package matches the Switch (Value) The Switch CaseTermList can include any number of Case<br />

instances, but no two Case Values (or members of a Value, if Value is a Package) within the same<br />

Switch statement can have the same value.<br />

Execution of the statement body begins at the selected TermList <strong>and</strong> proceeds until the TermList end<br />

of body or until a Break or Continue statement transfers control out of the body.<br />

The Default statement is executed if no Case Value matches the value of Switch (expression). If the<br />

Default statement is omitted, <strong>and</strong> no Case match is found, none of the statements in the Switch body<br />

Version 6.0 889

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!