I'm just trying to load the value of myarray[0] to eax:
        .text
        .data
        # define an array of 3 words
array_words:     .word 1, 2, 3
        .globl main
main:
        # assign array_words[0] to eax
        mov $0, %edi
        lea array_words(,%edi,4), %eax
But when I run this, I keep getting seg fault. Could someone please point out what I did wrong here?
 
     
     
    