I am attempting to mimic the following C code in assembly:
int x = 12;
int *y = &x;
int z = *y;
I have the following:
mov rbp, rsp
sub rsp, 16
mov DWORD [rbp - 4], 12
lea eax, [rbp - 4]
mov DWORD [rbp - 8], eax
mov eax, DWORD [rbp - 8]
mov edi, DWORD [eax]
However, I receive a segmentation fault when calling the last line of assembly. Am I missing another layer of indirection?