Skip to content

Instantly share code, notes, and snippets.

@RichardCSantana-zz
Created November 6, 2012 13:01
Show Gist options
  • Save RichardCSantana-zz/4024598 to your computer and use it in GitHub Desktop.
Save RichardCSantana-zz/4024598 to your computer and use it in GitHub Desktop.
Soma de dois números em assembly (Arquitetura Mips)
.text
main:
li $s0, 10 # insere o valor 10 no regitrador $s0
li $s1, 17 # insere o valor 17 no regitrador $s1
add $s2,$s1,$s0 # soma o valor dos registradores $s0 e $s1 e insere no registrador $s2
la $a0, ($s2) #coloca o registrador $s2 para ser impresso
li $v0,1 #comando de impressão de inteiro na tela
syscall # efetua a chamada ao sistema
li $v0, 10 # comando de exit
syscall # efetua a chamada ao sistema
@ssantdev3321
Copy link

thanks, this help me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment