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

MUL/IMUL flag setting is incorrect #16

Open
neldredge opened this issue Mar 9, 2023 · 0 comments · May be fixed by #24
Open

MUL/IMUL flag setting is incorrect #16

neldredge opened this issue Mar 9, 2023 · 0 comments · May be fixed by #24

Comments

@neldredge
Copy link

mul bl currently sets the carry and overflow flags if ah was nonzero on input. It should set them if ah is nonzero on output. I think somebody misread the manual.

The same goes for the other multiply instructions. Additionally, the flag set logic in IMUL is incorrect. It clears/sets them according to whether AH is equal to 0xff. Instead they should be cleared if AH equals the sign bit of AL (0xff or 0x00 as appropriate), otherwise set.

@KiN4Tec KiN4Tec linked a pull request Dec 6, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant