Computer Systems Org I - Prof. Grishman

Lecture 17 - Nov. 1, 2005

Allocating space for variables (P&P sec. 12.5.2)

Passing parameters (P&P sec. 14.3.2)

Pointers (P&P sec. 16.2)

The value of a pointer variable is, in effect, an address.
The declaration of a pointer variable indicates what type it points to:
    int* p 
is a pointer to an integer
The dereference operator, *, returns the value at the address specified by the pointer
 [this would be implemented by an LDR instruction on the LC-3]

Pointers make it possible to modify integer arguments
    ex:  NewSwap, P&P p. 432
They also make it possible to return multiple values from a function
    ex:  IntDivide, P&P p. 435