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

cg_arm.c in 19_Arrays_pt1 is out of sync #65

Open
vcheckzen opened this issue Jul 5, 2023 · 0 comments
Open

cg_arm.c in 19_Arrays_pt1 is out of sync #65

vcheckzen opened this issue Jul 5, 2023 · 0 comments

Comments

@vcheckzen
Copy link

if (Gsym[i].stype == S_VARIABLE)

if (Gsym[i].stype == S_VARIABLE)

Both lines should be changed to

 if (Gsym[i].stype == S_VARIABLE || Gsym[i].stype == S_ARRAY)

acwj/19_Arrays_pt1/cg_arm.c

Lines 270 to 271 in 14e9397

case 1: fprintf(Outfile, "%s:\t.byte\t0\n", Gsym[id].name); break;
case 4: fprintf(Outfile, "%s:\t.long\t0\n", Gsym[id].name); break;

should be changed to

 case 1:
 case 4:
    fprintf(Outfile, "%s:\n\t.zero\t%d\n", Gsym[id].name, Gsym[id].size * typesize);
    break;
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

1 participant