.globl main main: push %rbp # keep stack aligned # Print the prompt mov $0, %rax # clear AL (zero FP args in XMM registers) leaq prmpt(%rip), %rdi # load format string to proper register call printf # print it # Read int leaq f(%rip), %rdi # load format string leaq x(%rip), %rsi # set storage to address of x call scanf # mov $f, %rdi # Format string Already in register # mov %r12,%rsi # The value was just read into ithe memory in rsi!! xor %rax, %rax # Another way to 0 out %rax; wish I knew why call printf #print it; prints correct, but shouldn't?? pop %rbp ret .data prmpt: .string "Enter an int >"# Prompt f: .string "%d" # Format for input has only specifiers x: .long 0 # Variable (global)