Skip to content
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

ARM SBC and ADC update_flags always true #247

Closed
jabba2989 opened this issue Jan 13, 2015 · 5 comments
Closed

ARM SBC and ADC update_flags always true #247

jabba2989 opened this issue Jan 13, 2015 · 5 comments

Comments

@jabba2989
Copy link

It seems like that for sbc and adc (ARMv7-M Thumb2 Code) update_flags is always true even though the 's' suffix is omitted:

0x1000: (EB610102)  sbc.w   r2, r1, r1  
                    op_count: 3
                        operands[0].type: REG = r2
                        operands[1].type: REG = r1
                        operands[2].type: REG = r1
                    Update-flags: True
0x1004: (EB410102)  adc.w   r1, r1, r2
                    op_count: 3
                        operands[0].type: REG = r1
                        operands[1].type: REG = r1
                        operands[2].type: REG = r2
                    Update-flags: True
0x1008: (4191)      sbcs     r1, r2
                    op_count: 2
                        operands[0].type: REG = r1
                        operands[1].type: REG = r2
                    Update-flags: True

I used the official release (capstone 3.0).
Is this a known issue?

@aquynh
Copy link
Collaborator

aquynh commented Jan 13, 2015

adc & sbc update CPSR, thus update flags, no?

@jabba2989
Copy link
Author

Even if 's' is omitted? From the Reference Manual, it shouldn't (at least the condition flags should not be affected). Are any other bits in CPSR (or APSR for Profil-M) affected with absent 's' suffix?
add,sub and other arithmetic instructions work as expected.

@aquynh
Copy link
Collaborator

aquynh commented Jan 13, 2015

fixed in the next branch with your name credited: 67fe1c2

thanks.

@jabba2989
Copy link
Author

Works for me. Thanks.

@aquynh aquynh closed this as completed Jan 13, 2015
@aquynh
Copy link
Collaborator

aquynh commented Jan 13, 2015

please report if you find similar issues in other instructions.

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants