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

SAL instruction wrong behavior #1998

Closed
cr3m opened this issue Sep 10, 2024 · 2 comments
Closed

SAL instruction wrong behavior #1998

cr3m opened this issue Sep 10, 2024 · 2 comments

Comments

@cr3m
Copy link

cr3m commented Sep 10, 2024

I am using Unicorn-based emulator (Speakeasy) to emulate a sample but I saw that seems like the SAL instruction is not working properly

0x1401df85b: mem=0xd3cd2900000000f9
0x1401df85b: sal word ptr [rsp + r8 + 3], cl                             ; cf=0x0
0x1401df861: mem=0xd3cd2900000001f2
0x1401df861: inc rdx                                                     ; cf=0x1

The CF flag changed from 0 -> 1 while it shouldn't

SAL (or its synonym, SHL) shifts the bits of the operand upward. The high-order bit is shifted into the carry flag, and the low-order bit is set to 0.
@wtdcode
Copy link
Member

wtdcode commented Sep 10, 2024

Seems dup of #1717

@wtdcode
Copy link
Member

wtdcode commented Dec 29, 2024

Closing as no activities.

@wtdcode wtdcode closed this as completed Dec 29, 2024
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