title: How to print value of register in nasm assembly
body: <p>I'm trying to have the user enter a number, then print 1,2,3...[value]</p>
  
  <p>I have the following that is called after entering a number</p>
  
  <pre><code>printnum:
      mov ecx,0                   ;start at 0
      mov bl, [value] 
      jmp printnumloop    
  
  
  printnumloop:
      cmp     ecx, 0
      jle     actuallyprint
      jmp     menu
  
  actuallyprint:
       mov    rdi, [format]
       mov    edi, ecx
       mov    eax, 0
       call   printf
  
      mov     rdi, [LC8]
      mov     eax, 0
      call    printf
      add  edx, 1
  </code></pre>
  
  <p>LC8 is </p>
  
  <pre><code>LC8:    db  " , ",0
  </code></pre>
  
  <p>according to the debugger, the error is on this line</p>
  
  <pre><code>=&gt; 0x00007ffff7aa8ae3 &lt;+35&gt;:    movdqu xmm0,XMMWORD PTR [rdi]
  </code></pre>