title: How to build tree in Binary Search Tree node in MIPS assembly?
body: <p>Using the c code below:</p>
  
  <pre><code>void insert(node ** tree, int val)
  {
      node *temp = NULL;
      if(!(*tree))
      {
          temp = (node *)malloc(sizeof(node));
          temp-&gt;left = temp-&gt;right = NULL;
          temp-&gt;data = val;
          *tree = temp;
          return;
      }
  
      if(val &lt; (*tree)-&gt;data)
      {
          insert(&amp;(*tree)-&gt;left, val);
      }
      else if(val &gt; (*tree)-&gt;data)
      {
          insert(&amp;(*tree)-&gt;right, val);
      }
  
  }
  </code></pre>
  
  <p>I don't know how to start with a pointer to nothing, and then make a another node with value, &amp;left, &amp;right. In other words, when traversing the pointer of the node to the left, how would I make the current pointer point the left node and then point outwards as if pointing at the same object of the left.</p>
  
  <p>How to make move left/right?</p>
  
  <pre><code>right:      
  
      addi     $a3, $a3, 8
  
      jal build
  
  or
      right:      
  
      la a3, 8($a3)
  
      jal build
  </code></pre>