-
Notifications
You must be signed in to change notification settings - Fork 11
/
macros.json
43 lines (43 loc) · 1.02 KB
/
macros.json
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
{
"inc": {
"reg1": "$x",
"macro": "add $x, $x, 1"
},
"dec": {
"reg1": "$x",
"macro": "sub $x, $x, 1"
},
"swap": {
"comment_": "$z is used as intermediate. This macro swaps x with y",
"reg1": "$z",
"reg2": "$x",
"reg3": "$y",
"macro" : "move $z, $x
move $x, $y
move $y, $z"
},
"min": {
"reg1": "$x",
"reg2": "$y",
"reg3": "$z",
"uses_label" : "true",
"macro" : "blt $y, $z, __min_label__
move $x, $z
j __end_min_label__
__min_label__
move $x, $y
__end_min_label__"
},
"max": {
"reg1": "$x",
"reg2": "$y",
"reg3": "$z",
"uses_label" : "true",
"macro" : "blt $y, $z, __min_label__
move $x, $y
j __end_min_label__
__min_label__
move $x, $z
__end_min_label__"
}
}