title: Why use a bitwise not in MIPS instead of using exactly value?
body: <p>I'm trying to learn MIPS assembly, but I'm a bit confused about an example of MIPS assembly I have found.</p>
  <pre><code>#Socket Domain - AF_INET (2)
  li $t4, 0xFFFFFFFD #-3
  not $a0, $t4
  #Socket Type - SOCK_STREAM (2 for mips)
  not $a1, $t4
  #Socket Protocol - 0
  slti $a2, $zero, 0xFFFF
  #Call socket
  li $v0, 4183
  syscall 0x42424
  </code></pre>
  <p>For the socket() syscall, there are 3 arguments. The first argument being AF_INET or 2, why does the example above not just use <code>li $a0, 2</code> instead of:</p>
  <pre><code>li $t4, 0xFFFFFFFD #-3 
  not $a0, $t4
  </code></pre>
  <p>The line below is also used, what is the purpose of this with regards to the socket called?</p>
  <pre><code>slti $a2, $zero, 0xFFFF
  </code></pre>
  <p>Is this just the way the assembly has been 'optomized' by GCC? Or is their a reason?</p>