diff options
author | mjfernez <mjfernez@gmail.com> | 2021-10-12 20:18:28 -0400 |
---|---|---|
committer | mjfernez <mjfernez@gmail.com> | 2021-10-12 20:18:28 -0400 |
commit | 3cf128d6da667d00bb5bb659413ea55a98a02aff (patch) | |
tree | 12eb90997dfa63d65fe6da714626271272342320 /07-10001st-Prime/asm/prime.asm | |
parent | 009ce017d99a8deb2089438381c273e8f3ea3b67 (diff) | |
download | Project_Euler_Solutions-master.tar.gz |
Diffstat (limited to '07-10001st-Prime/asm/prime.asm')
-rw-r--r-- | 07-10001st-Prime/asm/prime.asm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/07-10001st-Prime/asm/prime.asm b/07-10001st-Prime/asm/prime.asm new file mode 100644 index 0000000..078db26 --- /dev/null +++ b/07-10001st-Prime/asm/prime.asm @@ -0,0 +1,24 @@ +; What is the 10 001st prime number? + +extern printf +SECTION .data +flag: db "%d",10,0 ; "%d\n\0" + +SECTION .text + global main + global is_divisible + +main: + push rbp ; set up stack + mov rbp, rsp + + +.print mov rdi, flag ; arg 1 (format) + mov rsi, rax ; arg 2 (value) + mov rax, 0 ; no xmm registers + call printf wrt ..plt + pop rbp + + mov rax, 0 + ret + |