From 5b069057fa9dadc84dd0782776c783b8c8eac35e Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Fri, 15 Sep 2023 11:57:47 +0000 Subject: [PATCH] chapter 0x01 explained --- 0x01.asm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 0x01.asm diff --git a/0x01.asm b/0x01.asm new file mode 100644 index 0000000..a492c2d --- /dev/null +++ b/0x01.asm @@ -0,0 +1,13 @@ + BITS 64 + SECTION .text + global main + +; calculate the fibonacci sequence. +; n_2 = n_1 + n_0 + +main: + mov rax, 1 ; inital values + mov rdx, 1 + .loop: ; a label + xadd rax, rdx ; swap rdx and rax, store rdx+rax into rax + loop .loop ; jump back to the .loop label