Page 23 - Struktur Data
P. 23

Vektor baris                                                                      Kode Mengakses Baris



    pgh[index] adalah



         array dengan 5 int



    Dimulai dari alamat                                                int *get_pgh_zip(int index)



       pgh+20*index                                                     {



 Kode                                                                        return pgh[index];



    Menghitung dan                                                     }



       mengembalikan alamat



    Perhitungan : pgh +


       4*(index+4*index)





                        # %eax = index


                         leal (%eax,%eax,4),%eax                                                            # 5 * index


                         leal pgh(,%eax,4),%eax                                                             # pgh + (20 * index)
   18   19   20   21   22   23   24   25   26   27   28