title: Writing a putchar in Assembly for x86_64 with 64 bit Linux?
body: <p>I am trying to use the write <code>syscall</code> in order to reproduce the <code>putchar</code> function behavior which prints a single character. My code is as follows,</p>
  
  <pre><code>asm_putchar:
    push    rbp
    mov     rbp, rsp
  
    mov     r8, rdi
  
  call:
    mov     rax, 1
    mov     rdi, 1
    mov     rsi, r8
    mov     rdx, 1
    syscall
  
  return:
    mov     rsp, rbp
    pop     rbp
    ret
  </code></pre>