Contents    Page-10    Prev    Next    Page+10    Index   

Array References

Suppose the following declarations have been made:

var i: integer; x: array[1..100] of real;
Assume that i has an offset of 4 and x has an offset of 8 (since x is double, its offset must be 8-aligned.). The total storage is 808. A reference x[i] would generate the code:

    (AREF X (+ -8 (* 8 I)))
The effective address is: %rbp, minus stack frame size, plus the offset of x, plus the expression (+ -8 (* 8 I)).