This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* file: "tinyc.c" */ | |
| /* Copyright (C) 2001 by Marc Feeley, All Rights Reserved. */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| /* | |
| * This is a compiler for the Tiny-C language. Tiny-C is a |