-
Notifications
You must be signed in to change notification settings - Fork 983
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
movzbl instruction can not compile in section 15_Pointers_pt1 and onward #62
Comments
Hi @davidle2023 ! I'm going to make an assumption that when Warren made this tutorial, he was using a version of as that would accept the movzbl opcode and generate suitable code. For example, on my Ubuntu 20.04 LTS test machine everything builds fine and runs with the expected results. However, on my Ubuntu 22.04 LTS test machine, I get different results than what you report but it boils down to the same thing: $ make test15 I tested my nasm code against both 20.04 and 22.04 because I was developing on 22.04 and running into errors with as code that magically went away under 20.04. Since my goal was to add nasm output to the existing compilers, I didn't try to fix what I was seeing in the as code. By the way, I like your report format. Jim |
int cgloadglob(int id) {
int r = alloc_register();
switch (Gsym[id].type) {
case P_CHAR:
fprintf(Outfile, "\tmovzbq\t%s(%%rip), %s\n", Gsym[id].name,
reglist[r]);
break;
case P_INT:
fprintf(Outfile, "\tmovzbl\t%s(\%%rip), %s\n", Gsym[id].name,
dreglist[r]); // There!!! reglist[r] => dreglist[r]
break;
case P_LONG:
case P_CHARPTR:
case P_INTPTR:
case P_LONGPTR:
fprintf(Outfile, "\tmovq\t%s(\%%rip), %s\n", Gsym[id].name, reglist[r]);
break;
default:
fatald("Bad type in cgloadglob:", Gsym[id].type);
}
return (r);
} |
Hi There,
There might be an issue with movzbl in section 15_Pointers_pt1 and onward.
Attaching the issue.15.txt for detail description. Thx!!!
Regards
David
P.S.: I am a newbie hence my report can be totally wrong.
issue.15.txt
The text was updated successfully, but these errors were encountered: