Skip to content
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