-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.s
60 lines (40 loc) · 1.01 KB
/
code.s
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
53
54
55
56
57
58
59
60
.data
jump: .word 0
String_: .ascii "BIGGER\0"
String_1: .ascii "SMALLER\0"
.text
.globl main
#< const ,int , ,jump >
#< = ,10 , ,jump >
li $9,10
la $8,jump
sw $9,($8)
#< func , , ,main >
main:
#< int , , ,a >
subi $sp,$sp,4
#< scanf , , ,a >
li $2,5
syscall
sw $2,-4($fp)
#< < ,10 ,a ,Function_ >
li $24,10
lw $25,-4($fp)
blt $24,$25,Function_
#< printf ,"BIGGER", , >
la $4,String_
li $2,4
syscall
#< jmp , , ,Function_1 >
j Function_1
#< lab , , ,Function_ >
Function_:
#< printf ,"SMALLER", , >
la $4,String_1
li $2,4
syscall
#< lab , , ,Function_1 >
Function_1:
#< exit , , ,main >
li $2,10
syscall