.section .text prompt: .asciz "Enter the number: " scanf_format: .asciz "%ld" .section .text .global tripleit tripleit: // Our argument will be in rdi mov %rdi, %rax mov $3, %r8 mul %r8 // The return value is expected to be in rax ret .global get_number get_number: push %rbp mov %rsp, %rbp # mov $prompt, %rdi # Using lea will allow this to work without --static # How'd we know the string is 49 bytes below rip? # Used the debugger. There's probably a better way though lea -49(%rip), %rdi call printf sub $16, %rsp # mov $scanf_format, %rdi lea -45(%rip), %rdi mov %rsp, %rsi call scanf pop %rax mov %rbp, %rsp pop %rbp ret .global fast_sqrt fast_sqrt: sqrtsd %xmm0, %xmm0 ret