New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iasl disassembler: C-style disassembly for Subtract(Y, X, X) is incorrect #75
Comments
We will start looking at this. |
Thanks for reporting this. The code did not properly handle disassembly of non-commutative compound operations (subtraction, division, and modulo). The following patch should fix it.
|
I thought this might affect other operators. Thanks for taking a detailed look. But regarding the patch, the shift operators are non-commutative. For example, ShiftLeft(1,0) != ShiftLeft(0,1). So, current code translates:
to
Which, of course, is not correct. Should be:
|
Another good catch. We think you deserve the "bug of the month" award for these, since they got past us not once but twice. Examples and new patch below.
diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c
|
Checking this in to the git tree. |
Care must be taken when disassembling operators like subtract and shift left. The operators cannot be interchanged, so there are additional restrictions on when these operators can be converted to a compound assignment. David Box.
Thanks! |
Consider this example:
Save to test.dsl, compile with 'iasl test.dsl'. Disassembly with 'iasl -dl test.aml' result (correct):
Disassembly with 'iasl -d test.aml' result:
The line:
It is wrong. Should be (as the case with Local2 result):
The text was updated successfully, but these errors were encountered: