.section .data scanf_format: .asciz "%lf" printf_format: .asciz "You entered: %lf\n" .section .text .global _start _start: sub $16, %rsp mov $scanf_format, %rdi mov %rsp, %rsi call scanf mov $printf_format, %rdi // mov (%rsp), %rax // mov $0x8000000000000000, %rbx // add %rbx, %rax // mov %rax, (%rsp) movsd (%rsp), %xmm0 addsd %xmm0, %xmm0 call printf mov $printf_format, %rdi // mov (%rsp), %rax // mov $0x8000000000000000, %rbx // add %rbx, %rax // mov %rax, (%rsp) movsd (%rsp), %xmm0 sqrtsd %xmm0, %xmm0 call printf mov $0, %rdi call exit