-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathin2.asm
More file actions
52 lines (52 loc) · 682 Bytes
/
Copy pathin2.asm
File metadata and controls
52 lines (52 loc) · 682 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
.text
.globl main
main:
li $t0, 10
sw $t0, num1
li $t0, 20
sw $t0, num2
lw $t0, num2
li $t1, 10
add $t2, $t0, $t1
li $t0, 10
add $t1, $t2, $t0
li $t0, 2
lw $t2, num2
mul $t3, $t0, $t2
bne $t1, $t3, L1
lw $t0, num1
li $v0, 1
move $a0, $t0
syscall
li $v0, 4
la $a0, _nl
syscall
lw $t0, num2
li $v0, 1
move $a0, $t0
syscall
li $v0, 4
la $a0, _nl
syscall
L1:
lw $t0, num1
li $v0, 1
move $a0, $t0
syscall
li $v0, 4
la $a0, _nl
syscall
lw $t0, num2
li $v0, 1
move $a0, $t0
syscall
li $v0, 4
la $a0, _nl
syscall
li $v0, 10
syscall
.data
.align 4
_nl: .asciiz "\n"
num1: .word 0
num2: .word 0