.section .data scanf_format: .asciz "%d" prompt: .asciz "Enter your age in years: " entry_check: .asciz "You entered %d\n" final_message: .asciz "Your age in mayfly lifespans is %d\n" .section .text .globl main main: # Prompt the user for a number mov $prompt, %rdi mov $0, %rax call printf # Read the number with scanf push %rax mov $scanf_format, %rdi mov %rsp, %rsi call scanf pop %rsi # The number ends up in rsi # Print out the number entered push %rsi mov $entry_check, %rdi mov $0, %rax call printf pop %rbx # Multiply movl $(365/4), %eax mull %ebx # Output Result mov %rax, %rsi mov $final_message, %rdi mov $0, %rax call printf # Exit the program with status 0 movl $1, %eax movl $0, %ebx int $0x80