Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
fib
section .data msg1: db "Fibonacci of 10: fib(10) = ", 10, 0 char: db 0, 0 section .text global main main: mov rdi, msg1 call print push 9 call fib add rsp, 8 call print mov rdi, 0 mov rax, 60 syscall fib: push rbp push rbx mov rbp, rsp add rbp, 24 mov ebx, [rbp] cmp ebx, 1 jle base lea ecx, [ebx-1] push rcx call fib pop rcx push rax lea ecx, [ebx-2] push rcx call fib pop rcx pop rcx add eax, ecx jmp end base: mov eax, 1 end: pop rbx pop rbp ret print: mov rsi, rsp sub rsi, 1 mov ecx, 10 .L1: xor edx, edx div ecx or dl, 0x30 sub rsi, 1 mov [rsi], dl test eax, eax jne .L1 mov rdx, rsp sub rdx, rsi mov rdi, 1 mov eax, 1 syscall ret
run
|
edit
|
history
|
help
0
dsffsdfsdfds
fdsafddfasfdsasafd
dsadsadasdsa
MyFirst Program
index2
Input and Display a number
Fib
dfsfsfsfsafd
hello1
Assembly : Allocating Storage Space