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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
# Evaluate this file only once in case it's included more than once
.ifndef _MACRO_INC_GUARD
.internal _MACRO_INC_GUARD
.set _MACRO_INC_GUARD, 1
# A function symbol.
.macro glabel label, visibility=global
.\visibility \label
.type \label, @function
\label:
.ent \label
.endm
# The end of a function symbol.
.macro endlabel label
.size \label, . - \label
.end \label
.endm
# An alternative entry to a function.
.macro alabel label, visibility=global
.\visibility \label
.type \label, @function
\label:
.aent \label
.endm
# A label referenced by an error handler table.
.macro ehlabel label, visibility=global
.\visibility \label
\label:
.endm
# A label referenced by a jumptable.
.macro jlabel label, visibility=local
.\visibility \label
\label:
.endm
# A data symbol.
.macro dlabel label, visibility=global
.\visibility \label
.type \label, @object
\label:
.endm
# End of a data symbol.
.macro enddlabel label
.size \label, . - \label
.endm
# Label to signal the symbol haven't been matched yet.
.macro nonmatching label, size=1
.global \label\().NON_MATCHING
.type \label\().NON_MATCHING, @object
.size \label\().NON_MATCHING, \size
\label\().NON_MATCHING:
.endm
# COP0 register aliases
.set Index, $0
.set Random, $1
.set EntryLo0, $2
.set EntryLo1, $3
.set Context, $4
.set PageMask, $5
.set Wired, $6
.set Reserved07, $7
.set BadVaddr, $8
.set Count, $9
.set EntryHi, $10
.set Compare, $11
.set Status, $12
.set Cause, $13
.set EPC, $14
.set PRevID, $15
.set Config, $16
.set LLAddr, $17
.set WatchLo, $18
.set WatchHi, $19
.set XContext, $20
.set Reserved21, $21
.set Reserved22, $22
.set Reserved23, $23
.set Reserved24, $24
.set Reserved25, $25
.set PErr, $26
.set CacheErr, $27
.set TagLo, $28
.set TagHi, $29
.set ErrorEPC, $30
.set Reserved31, $31
# Float register aliases (o32 ABI, odd ones are rarely used)
.set $fv0, $f0
.set $fv0f, $f1
.set $fv1, $f2
.set $fv1f, $f3
.set $ft0, $f4
.set $ft0f, $f5
.set $ft1, $f6
.set $ft1f, $f7
.set $ft2, $f8
.set $ft2f, $f9
.set $ft3, $f10
.set $ft3f, $f11
.set $fa0, $f12
.set $fa0f, $f13
.set $fa1, $f14
.set $fa1f, $f15
.set $ft4, $f16
.set $ft4f, $f17
.set $ft5, $f18
.set $ft5f, $f19
.set $fs0, $f20
.set $fs0f, $f21
.set $fs1, $f22
.set $fs1f, $f23
.set $fs2, $f24
.set $fs2f, $f25
.set $fs3, $f26
.set $fs3f, $f27
.set $fs4, $f28
.set $fs4f, $f29
.set $fs5, $f30
.set $fs5f, $f31
.endif
|