Re: Hello world! Examples of different languages
![]()
copy ekumunng
[fd@localhost ~]$ cat helloEK.c
main()
{
printf("Hello World
");
}
compile:
[fd@localhost ~]$ gcc -o helloEK helloEK.c
check:
[fd@localhost ~]$ ./helloEK
Hello World
convert to assembly:
[fd@localhost ~]$ gcc -S helloEK.c
[fd@localhost ~]$ cat helloEK.s
.file "helloEK.c"
.section .rodata
.LC0:
.string "Hello World"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
andl $-16, %esp
subl $16, %esp
movl $.LC0, (%esp)
call puts
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (GNU) 4.8.2 20131212 (Red Hat 4.8.2-7)"
.section .note.GNU-stack,"",@progbits
[fd@localhost ~]$
assembly :halo: