Skip to content

Instantly share code, notes, and snippets.

@cecyurbina
Created February 21, 2012 02:00
.file "fibo.c"
.section .rodata
.LC0:
.string "%ld\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $48, %rsp
movl %edi, -36(%rbp)
movq %rsi, -48(%rbp)
movq $1, -32(%rbp)
movq $0, -24(%rbp)
movl $0, -4(%rbp)
jmp .L2
.L3:
movq -24(%rbp), %rax
movq -32(%rbp), %rdx
addq %rdx, %rax
movq %rax, -16(%rbp)
movl $.LC0, %eax
movq -16(%rbp), %rdx
movq %rdx, %rsi
movq %rax, %rdi
movl $0, %eax
call printf
movq -24(%rbp), %rax
movq %rax, -32(%rbp)
movq -16(%rbp), %rax
movq %rax, -24(%rbp)
addl $1, -4(%rbp)
.L2:
cmpl $50, -4(%rbp)
jle .L3
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1"
.section .note.GNU-stack,"",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment