ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
symbols.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 // Atari a.out / ELF symbol handling by Thorsten Otto.
23 // include in each of the .S files and put every global symbol into
24 // SYM(<symbol name>).
25 
26 #ifndef __USER_LABEL_PREFIX__
27 #define __USER_LABEL_PREFIX__ _
28 #endif
29 
30 #ifndef __REGISTER_PREFIX__
31 #define __REGISTER_PREFIX__
32 #endif
33 
34 #ifndef __IMMEDIATE_PREFIX__
35 #define __IMMEDIATE_PREFIX__ #
36 #endif
37 
38 #define CONCAT1(a, b) CONCAT2(a, b)
39 #define CONCAT2(a, b) a ## b
40 
41 /* Use the right prefix for global labels. */
42 
43 #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
44 
45 #ifdef __ELF__
46 #define FUNC(x) .type SYM(x),function
47 #else
48 /* The .proc pseudo-op is accepted, but ignored, by GAS. We could just
49  define this to the empty string for non-ELF systems, but defining it
50  to .proc means that the information is available to the assembler if
51  the need arises. */
52 #define FUNC(x) .proc
53 #endif
54 
55 #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
56 
57 #define IMM(x) CONCAT1 (__IMMEDIATE_PREFIX__, x)
58 
59 #define d0 REG(d0)
60 #define d1 REG(d1)
61 #define d2 REG(d2)
62 #define d3 REG(d3)
63 #define d4 REG(d4)
64 #define d5 REG(d5)
65 #define d6 REG(d6)
66 #define d7 REG(d7)
67 #define a0 REG(a0)
68 #define a1 REG(a1)
69 #define a2 REG(a2)
70 #define a3 REG(a3)
71 #define a4 REG(a4)
72 #define a5 REG(a5)
73 #define a6 REG(a6)
74 #define a7 REG(a7)
75 #define fp REG(fp)
76 #define sp REG(sp)
77 #define pc REG(pc)
78 
79 #define sr REG(sr)