title: input a floating point number an output it back to the screen in Assembly?
body: <p>i've been working on this assignment, and cant get past one of the first parts, which should be simple.  Ive been over it with my professor, but he can't figure it out either...I was hoping for some help here.  I just want to input a number, push it into st0, then pop and store it into total_mean.  For testing purposes, ive commented out the code in the beginning.  </p>
  
  <pre><code>extern printf
  extern scanf
  
  segment .data
      prompt_name db "Please enter you name: ", 0
      input_name db "%s %s",0
      ready db "Please have your numberic data ready",10,0
      get_num db "Enter a floating number: ",0
      stringdata db "%s",0
  
      namedata db "%s ",0
      display_name db "%s",10,0
      floatdata db "%Lf",0
      ask db "Are there more numbers (Y or N)? ", 0
  
      mean db "The mean of these %d values is %Lf",10,0
      largest db "the largest value is %Lf",10,0
      smallest db "the smallest value is %Lf",10,0
  
      more db "Do you have more data to analyze (Y or N)? ",0
  
      bye db "Thank you %s. I hope you enjoyed this program.",10,0
  
  
  segment .bss
      user_float: resq 1
      large: resq 1
      small: resq 1
      total_mean: resq 2
      first_name: resb 32
      last_name: resq 32
  
  segment .text
  
      global start_loop
  
  start_loop:
  
  ;   mov rax,0
  ;   mov rdi, stringdata
  ;   mov rsi, prompt_name
  ;   call printf
  ;
  ;   mov qword rax, 0
  ;   mov rdi, input_name
  ;   mov rsi, first_name
  ;   mov rdx, last_name
  ;   call scanf
  ;
  ;   mov rax, 0
  ;   mov rdi, namedata
  ;   mov rsi, first_name
  ;   call printf
  ;
  ;   mov rax, 0
  ;   mov rdi, display_name
  ;   mov rsi, last_name
  ;   call printf
  ;
  ;   mov rax, 0
  ;   mov rdi, stringdata
  ;   mov rsi, ready
  ;   call printf
  ;
  ;   mov rax, 0
  ;   mov rdi, stringdata
  ;   mov rsi, get_num
  ;   call printf
  
      mov qword rax, 0
      push qword 0
      push qword 0
      mov rdi, floatdata
      mov rsi, rsp
      call scanf
  
      push qword 0
      push qword 0
  
      fld tword [rsp]
      fmul
  
      fstp tword [total_mean]
  
      mov qword rax, 0
      mov qword rax,0
      mov rdi, floatdata
      mov rsi, total_mean
      call printf
  
      pop rax
      pop rax
      pop rax
      pop rax
  
  ret
  </code></pre>
  
  <p>Its just the bottom half where im trying to get an input from the keyboard that im having a problem with.  When i input a number, such as 12.0, and display it, it displays 0.00000.  Can anyone help me find a solution to this please?</p>