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

A wrong nasm assembly instruction in cgn.c of 08_If_Statements #64

Open
vcheckzen opened this issue Jun 26, 2023 · 1 comment
Open

A wrong nasm assembly instruction in cgn.c of 08_If_Statements #64

vcheckzen opened this issue Jun 26, 2023 · 1 comment

Comments

@vcheckzen
Copy link

vcheckzen commented Jun 26, 2023

https://github.com/DoctorWkt/acwj/blob/14e9397369dcd428ee7ba6dcf290407403f4c4e7/08_If_Statements/cgn.c#L157C68-L157C68

movzb cannot be recognised by nasm, it should be substituted by movzx according to the nasm doc.

MOVZX            reg16,mem                386 
MOVZX            reg16,reg8               386 
MOVZX            reg32,rm8                386 
MOVZX            reg32,rm16               386 
MOVZX            reg64,rm8                X86_64,LONG 
MOVZX            reg64,rm16               X86_64,LONG 
@the-grue
Copy link
Contributor

Hi @vcheckzen ! It would appear you are correct. Apparently that code wasn't exercised by the test, so I didn't catch and correct it. Later versions have the correct opcode.

Feel free to submit a pull request for the fix since you found it.

Jim

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