【发布时间】:2012-11-01 23:21:32
【问题描述】:
我是 at&t 语法的新手。我用gcc -S test.c编译了一个test.c文件。
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)
我知道-8(%ebp) 是一个本地变量,但不确定$temp 是什么意思
如何在 nasm 中做到这一点?
我在 .bss 部分中有一个全局温度
我可以说:
-
mov eax, [ebp-8]; eax是否包含[ebp-8]的内存地址? -
mov ebx, temp; ebx 是否包含 temp 的地址? -
mov [eax], ebx;这是否意味着使局部变量指向 temp,还是在局部变量中创建 temp 的副本?
【问题讨论】:
-
为了间接回答你的问题,为什么不用gcc output Intel syntax?
-
我有一个问题。照你说的做了。是的,看起来不错。 “mov edx, DWORD PTR [eax]”中的PTR是什么意思,因为它无处不在
-
可以省略吗? @一种。韦伯