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

Update Readme.md for Part 15. #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions 15_Pointers_pt1/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,25 @@ The `leaq` instruction loads the address of the named identifier.
In the section function, the `(%r8)` syntax loads the value that
register `%r8` points to.

### Corresponding changes to cgstorglob and cgloadglob

cgloadglob :
```c
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]);
```
cgstorglob :
```c
case P_LONG:
case P_CHARPTR:
case P_INTPTR:
case P_LONGPTR:
fprintf(Outfile, "\tmovq\t%s, %s(\%%rip)\n", reglist[r], Gsym[id].name);
```

## Testing the New Functinality

Here's our new test file, `tests/input15.c` and the result when we
Expand Down