title: Substract in Mips
body: <p>The problem appears when I wait for the result of the substraction to appear but instead it shows me 0. Not x-a as I hoped it will.</p>
  
  <pre><code>.data
  
  
  strin: .asciiz "type two integers\n\n\n" 
  
  strout: .asciiz "the result of the substract is:"
  
  a: .word 0
  
  x: .word 1
  
  
  
  .text
  
  main:
  
  li $v0, 4                                                                          
  la $a0,strin                                                                 
  syscall  
  
  li $v0, 5
  syscall
  sw $t0,a
  
  li $v1,5
  syscall
  sw $t1,x
  
  
  sub $t1,$t1,$t0                                      
  
  
  li $v0, 4                                                                          
  la $a0,strout                                                                                   
  syscall
  
  move $a0, $t1                   
  li $v0, 1                        
  syscall
  
  li $v0,10                                               
  syscall
  </code></pre>