Buscar

drive-download-20240404T141337Z-001

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

exerc5 - Aula2.asm
.data
X: .word 5
NUM: .word 0
MSGMN: .asciiz "\nTente Novamente, este numero eh MENOR\n "
MSGMA: .asciiz "\nTente novamente, este numero eh MAIOR\n "
MSGAA: .asciiz "\nParabens, este eh o numero correto"
MSGNR: .asciiz "\nDigite um numero: "
.text
la $s1, X
lw $t1, 0($s1)
	
loop: 
	
li $v0,4
la $a0, MSGNR
syscall
li $v0,5
syscall
la $s0,NUM
lw $t0, 0($s0)
move $t0,$v0
sw $t0,0($s0)
blt $t0,$t1,menor
bgt $t0,$t1,maior
bne $t0,$t1,loop 
b acertou 
li $v0,4
la $a0, MSGMA
syscall
	
	
menor:
li $v0,4
la $a0, MSGMN
syscall
b loop
	
maior:
li $v0,4
la $a0, MSGMA
syscall
b loop
	
acertou:
li $v0,4
la $a0, MSGAA
syscall
	
exerc2 - Aula2.asm
.data
MSG: .asciiz "Digite a Idade do condutor:"
MSGp: .asciiz "Pode dirigir"
MSGn: .asciiz "Nao Pode Dirigir"
.text 
li $v0,4
la $a0, MSG
syscall
li $v0,5
syscall
bge $v0,18,maior
li $v0,4
la $a0, MSGn
syscall
b fim #tira do loop
maior: 
li $v0,4
la $a0, MSGp
syscall
fim: #tira do loop
exerc4 - Aula2.asm
.data
NUM: .word 5
MSG: .asciiz "\n"
.text
li $t0, 0	
la $s0, NUM
lw $t1, 0($s0)
	
loop:	
addi $t0, $t0, 1
li $v0,4
la $a0, MSG
syscall
li $v0, 1
move $a0, $t0
syscall
blt $t0, $t1, loop
li $v0, 1
move $a0, $t0
syscall
exerc1 - Aula2.asm
.data
A: .word 666
MSG: .asciiz "Digite um numero:"
.text 
li $v0,4
la $a0, MSG
syscall
li $v0,5
syscall
move $a0,$v0
li $v0, 1
syscall 
exerc3 - Aula2.asm
.data
NUM: .word 5
.text
li $t0, 0	
la $s0, NUM
lw $t1, 0($s0)
	
loop:	
addi $t0, $t0, 1
blt $t0, $t1, loop
	
li $v0, 1
move $a0, $t0
syscall
exerc6 - Aula2.asm
#Result t1, t0
li $t0, 0
li $t1, 0
#64 bit number t3, t2
li $t2, 0xFFFFFFFF
li $t3, 0
#64bit number t5, t4
li $t4, 1
li $t5, 0
addu $t0, $t2, $t4 # add least significant word
sltu $t1, $t0, $t4 # set carry-in bit
addu $t1, $t1, $t3 # add in first most significant word
addu $t1, $t1, $t5 # add in second most significant word

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Continue navegando