title: MIPS subroutine vs C functions
body: <p>Say I have the following C code:</p>
  
  <pre><code>int array[10] = {10, 5, 2, 20, 20, -5, 3, 19, 9, 1};
  void main(void)
  {
        printArray(0, 9);
  }
  void printArray(int startIndex, int endIndex)
  {
        // prints out the numbers in the order starting from startIndex
        // and ending at endIndex
  }
  </code></pre>
  
  <p>I would translate this C code into MIPS as so:</p>
  
  <pre><code>    .text
      .globl main
  
  main:
     # ...
  
      .text
      .globl printArray
  printArray:
      # play with registers
  print:
  # used to loop
  </code></pre>
  
  <p>I am confused. In that MIPS code, is <code>main</code> and <code>printArray</code>, by being <code>global</code>, would be the equivalent of a C function, right? But would print also be? If not, does <code>print</code> have an equivalent in C?</p>