title: Callling the brk syscall using inline assembler
body: <p>How can I implement brk syscall in x86-64 linux? My code is as follows:</p>
  
  <pre><code>    Mysyscall(uint64_t n, uint64_t a1){
      uint64_t ret;
      __asm__ __volatile__("movq %0, %%rax\n\t"
              "movq %1, %%rdi\n\t"
              "syscall\n"
              : "=r"(ret)
              : "g"(n), "g"(a1));
      return ret; }
  
      Mysyscall(SYS_brk, uint64_t increment);
  </code></pre>
  
  <p>But it is not working. I think I may use wrong constraints for asm operands. but still find it difficult to figure out.</p>