본문 바로가기

MIPS/공부

입력값에 10을 더해 출력하는 프로그램

.data
msg1:   .asciiz "Please, type a number:"
msg2:   .asciiz "The results is "

.text
.globl main
main:                    
	li $v0, 4     
            la $a0, msg1   
            syscall      

	li $v0,5 	       
	syscall
	move $t0,$v0	
	addi $t1,$t0,10  

	li $v0, 4     
            la $a0, msg2    
            syscall        

	li $v0,1    
	move$a0,$t1
	syscall