I'm new to at&t
syntax. I compiled a test.c file with gcc -S test.c
.
part of file in test.s:
1. .file "test.c"
2. .local temp
3. .comm temp,8,4
4. ...
5. funtion1:
6. blah
7. blah
8. blah
9. movl $temp, -8(%ebp)
I know -8(%ebp)
is a local var,but not sure what $temp
means
How can this be done in nasm?
I have a global temp in the .bss section
can i say:
mov eax, [ebp-8]
; Does eax contains the memory address of [ebp-8]?mov ebx, temp
; Does ebx contain the address of temp?mov [eax], ebx
; Does this mean make the local variable point to temp, or that it makes a copy of temp in the local variable?