Skip to content

Instantly share code, notes, and snippets.

@pervognsen pervognsen/fib.be
Last active May 16, 2016

Embed
What would you like to do?
fib_input : uint64;
fib_output : uint64;
{
fib_input = 10;
n register := fib_input;
x register := 0;
y register := 1;
while (n) {
z register := x;
x = y;
y = y + z;
n = n - 1;
}
fib_output = x;
}
fib.bin: file format binary
Disassembly of section .data:
0000000000000000 <.data>:
0: 48 bd 00 00 b1 a8 d0 movabs rbp,0x1d0a8b10000
7: 01 00 00
a: 48 c7 05 e3 ff ff ff mov QWORD PTR [rip+0xffffffffffffffe3],0xa # 0xfffffffffffffff8
11: 0a 00 00 00
15: 48 8b 0d dc ff ff ff mov rcx,QWORD PTR [rip+0xffffffffffffffdc] # 0xfffffffffffffff8
1c: 48 c7 c3 00 00 00 00 mov rbx,0x0
23: 48 c7 c6 01 00 00 00 mov rsi,0x1
2a: 48 81 f9 00 00 00 00 cmp rcx,0x0
31: 0f 84 16 00 00 00 je 0x4d
37: 48 8b fb mov rdi,rbx
3a: 48 8b de mov rbx,rsi
3d: 48 03 f7 add rsi,rdi
40: 48 81 e9 01 00 00 00 sub rcx,0x1
47: 48 e9 dd ff ff ff jmp 0x2a
4d: 48 89 1d 9c ff ff ff mov QWORD PTR [rip+0xffffffffffffff9c],rbx # 0xfffffffffffffff0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.