title: Mips Stack Pointer can't reach next stack value
body: <p>i'm trying to do a program in mars that , using $sp, can jump to the next address of the stack and read the value:</p>
  
  <pre><code>fine_while:
  
  add $a0, $S,$a2
  li $v0, 1
  syscall
  move  $t5, $sp#indirizzo iniziale
  move $sp, $t6 #indiirzzi di -51
  subi  $sp, $sp, 4 #shifto di una podizione il sp ora come se 2 fosse quello iniziale.probabilmente i negativ occupano + byte
  lw $a2, ($sp)
  move $t6, $sp #e lo pongo uguale ad a2 #ATTENZIONE! qui stai ponendo il ad a2 l'indirizzo!!!
  move $sp, $t5#riprsitino l sp
  #incremenro sp di 4 per prepararmk ad immagazinare 4
  #chiamare un nuobo elmeneto (4) e mettilo 
  li $v0 , 5
  syscall 
  move $a1, $v0 
  subi  $sp, $sp, 4 
  sw $a1,($sp)
  beqz $a1 , end  
  sub $S, $S,$a2 #qui difatti stai sottraendo l indirzzo e non il contenuto...
  add $S,$S, $a1
  j fine_while
  </code></pre>
  
  <p>this is only a piece of source cause there are another operations( i have a sequence of numbers and i saved its into the stack) , the problem is that in a particoular time when i jump to next  stack address to reach the next number mips says that this cell is equal to zero, but why? in the cell there is a number that i allocated , right? but it's like it s empty, why? thank you</p>