title: Execve inline assembly
body: <p>I recently got into gcc's inline assembly and having basic assembly knowledge, I understood how to make syscalls pretty well until I tried to do a simple sys_execve with one or more arguments.
  The system call execve works fine if I am not passing it any additional parameters, and just runs the executable without parameters when trying to pass any.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  char *argv[]={"/bin/echo","parameter test", NULL};
  
  int main(){
    __asm__ volatile ("int $0x80"
            :
            :"a"(11), // syscall number (execve)
             "b"(argv[0]), // filename
             "c"(argv), // arguments
             "d"(0)); // env
    return 0;
  }
  </code></pre>
  
  <p>I have no idea what could go wrong, as I have tested this with</p>
  
  <pre><code>execve(argv[0], argv, NULL);
  </code></pre>
  
  <p>and it worked as expected.</p>