title: Print newline with as little code as possible with NASM
body: <p>I'm learning a bit of assembly for fun and I am probably too green to know the right terminology and find the answer myself.</p>
  
  <p>I want to print a newline at the end of my program.</p>
  
  <p>Below works fine.</p>
  
  <pre><code>section .data
      newline db 10
  
  section  .text
  _end:
      mov rax, 1
      mov rdi, 1
      mov rsi, newline
      mov rdx, 1
      syscall
  
      mov rax, 60
      mov rdi, 0
      syscall
  </code></pre>
  
  <p>But I'm hoping to achieve the same result without defining the newline in .data. Is it possible to call <code>sys_write</code> directly with the byte you want, or must it always be done with a reference to some predefined data (which I assume is what <code>mov rsi, newline</code> is doing)?</p>
  
  <p>In short, why can't I replace <code>mov rsi, newline</code> by <code>mov rsi, 10</code>?</p>