title: MIPS dynamic memory allocation using sbrk
body: <p>I was trying to use <code>sbrk</code> for dynamic memory allocation. But, being a newcomer to SPIM and MIPS, I was unable to do so. I sketched out a rough code for the same.</p>
  <pre><code>.data
      var: .word 25
  .text   
      main:
          li $v0, 9
          la $v0, var
          lw $a0, var
          syscall     # DYNAMICALLY ALLOCATING MEMORY OF SIZE 4 BYTES AT ADDRESS OF VAR
          sw $v0, var
          
          li $v0, 10
          syscall
  </code></pre>