.section .data scanf_format: .asciz "%d" prompt: .asciz "Enter a number: " result_message: .asciz "You entered %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 results mov $result_message, %rdi mov $0, %rax call printf # Exit the program with status 0 movl $1, %eax movl $0, %ebx int $0x80