Created
February 18, 2015 02:23
-
-
Save KatrinaHoffert/7e49391ef1979b6f4ad3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.file "hello.c" | |
.section .rdata,"dr" | |
.LC0: | |
.ascii "Hello, World!\0" | |
.text | |
.globl sayHello | |
.def sayHello; .scl 2; .type 32; .endef | |
.seh_proc sayHello | |
sayHello: | |
pushq %rbp | |
.seh_pushreg %rbp | |
movq %rsp, %rbp | |
.seh_setframe %rbp, 0 | |
subq $32, %rsp | |
.seh_stackalloc 32 | |
.seh_endprologue | |
leaq .LC0(%rip), %rcx | |
call puts | |
nop | |
addq $32, %rsp | |
popq %rbp | |
ret | |
.seh_endproc | |
.ident "GCC: (GNU) 4.9.2" | |
.def puts; .scl 2; .type 32; .endef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.file "main.c" | |
.def __main; .scl 2; .type 32; .endef | |
.text | |
.globl main | |
.def main; .scl 2; .type 32; .endef | |
.seh_proc main | |
main: | |
pushq %rbp | |
.seh_pushreg %rbp | |
movq %rsp, %rbp | |
.seh_setframe %rbp, 0 | |
subq $32, %rsp | |
.seh_stackalloc 32 | |
.seh_endprologue | |
call __main | |
call sayHello | |
movl $0, %eax | |
addq $32, %rsp | |
popq %rbp | |
ret | |
.seh_endproc | |
.ident "GCC: (GNU) 4.9.2" | |
.def sayHello; .scl 2; .type 32; .endef |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment