【发布时间】:2010-10-04 19:20:43
【问题描述】:
我刚刚翻译了这个程序,
#include <stdio.h>
int dam[1000][1000];
int main (int argc, const char * argv[]) {
// insert code here...
printf("Hello, World!\n");
return 0;
}
使用 gcc 生产组装,
.cstring
LC0:
.ascii "Hello, World!\0"
.text
.globl _main
_main:
pushl %ebp
movl %esp, %ebp
pushl %ebx
subl $20, %esp
call L3
"L00000000001$pb":
L3:
popl %ebx
leal LC0-"L00000000001$pb"(%ebx), %eax
movl %eax, (%esp)
call L_puts$stub
movl $0, %eax
addl $20, %esp
popl %ebx
leave
ret
.comm _dam,1000000,5
.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
L_puts$stub:
.indirect_symbol _puts
hlt ; hlt ; hlt ; hlt ; hlt
.subsections_via_symbols
.comm 是什么意思? dam使用堆空间、栈空间还是数据空间?
【问题讨论】:
标签: gcc assembly x86 gnu-assembler