-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmips-1.asm
44 lines (31 loc) · 804 Bytes
/
mips-1.asm
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
.data
string1: .asciiz "Enter a number:"
string2: .asciiz "Enter the secon number:"
string3: .asciiz "Sum:"
endLine: .asciiz "\n"
.text
main:
li $v0 , 4 #print string1
la $a0 , string1
syscall
li $v0 , 5 #read integer
syscall
move $t0,$v0 #Girdiğimiz integer değeri temporary(geçici) değere akttardık.
li $v0 , 4
la $a0 , endLine #Boşluk vermek için.
syscall
li $v0 , 4
la $a0 , string2
syscall
li $v0 , 5
syscall
move $t1,$v0
li $v0 , 4
la $a0 , string3
syscall
add $t2,$t1,$t0 #İki tane yazdığımız integer değerleri toplayıp $t2 temporary değere aktardık.s
li $v0, 1 #print integer
move $a0, $t2 #Temporary değeri a0 a aktardık.
syscall
li $v0, 10 #exit
syscall