-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbet.s
More file actions
52 lines (40 loc) · 827 Bytes
/
bet.s
File metadata and controls
52 lines (40 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.data
msg1: .asciiz "\nDigite um numero inteiro: "
msgigual: .asciiz "\nSão iguais"
msgmaior: .asciiz "\nO primeiro e maior que o segundo"
msgmenor: .asciiz "\nO segundo e maior que o primeiro"
.text
main:
li $v0, 4
la $a0, msg1
syscall
li $v0, 5
syscall
add $t1, $v0, $zero # primeiro
li $v0, 4
la $a0, msg1
syscall
li $v0, 5
syscall
add $t2, $v0, $zero
beq $t1, $t2, igual
sgt $t3,$t1, $t2
beq $t3,$zero,maior
slt $t4,$t1, $t2
beq $t4,$zero,menor
igual:
li $v0, 4
la $a0, msgigual
syscall
j $ra
maior:
li $v0, 4
la $a0, msgmenor
syscall
j $ra
menor:
li $v0, 4
la $a0, msgmaior
syscall
j $ra
j$ra