source:
rtems/c/src/exec/score/cpu/m68k/asm.h
@
3a4ae6c
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39 | |
---|---|
|
|
File size: 2.7 KB |
Line | |
---|---|
1 | /* asm.h |
2 | * |
3 | * This include file attempts to address the problems |
4 | * caused by incompatible flavors of assemblers and |
5 | * toolsets. It primarily addresses variations in the |
6 | * use of leading underscores on symbols and the requirement |
7 | * that register names be preceded by a %. |
8 | * |
9 | * |
10 | * NOTE: The spacing in the use of these macros |
11 | * is critical to them working as advertised. |
12 | * |
13 | * COPYRIGHT: |
14 | * |
15 | * This file is based on similar code found in newlib available |
16 | * from ftp.cygnus.com. The file which was used had no copyright |
17 | * notice. This file is freely distributable as long as the source |
18 | * of the file is noted. This file is: |
19 | * |
20 | * COPYRIGHT (c) 1994. |
21 | * On-Line Applications Research Corporation (OAR). |
22 | * |
23 | * $Id$ |
24 | */ |
25 | |
26 | #ifndef __M68k_ASM_h |
27 | #define __M68k_ASM_h |
28 | |
29 | /* |
30 | * Indicate we are in an assembly file and get the basic CPU definitions. |
31 | */ |
32 | |
33 | #define ASM |
34 | #include <rtems/core/m68k.h> |
35 | |
36 | /* |
37 | * Recent versions of GNU cpp define variables which indicate the |
38 | * need for underscores and percents. If not using GNU cpp or |
39 | * the version does not support this, then you will obviously |
40 | * have to define these as appropriate. |
41 | */ |
42 | |
43 | #ifndef __USER_LABEL_PREFIX__ |
44 | #define __USER_LABEL_PREFIX__ _ |
45 | #endif |
46 | |
47 | #ifndef __REGISTER_PREFIX__ |
48 | #define __REGISTER_PREFIX__ |
49 | #endif |
50 | |
51 | /* ANSI concatenation macros. */ |
52 | |
53 | #define CONCAT1(a, b) CONCAT2(a, b) |
54 | #define CONCAT2(a, b) a ## b |
55 | |
56 | /* Use the right prefix for global labels. */ |
57 | |
58 | #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) |
59 | |
60 | /* Use the right prefix for registers. */ |
61 | |
62 | #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) |
63 | |
64 | #define d0 REG (d0) |
65 | #define d1 REG (d1) |
66 | #define d2 REG (d2) |
67 | #define d3 REG (d3) |
68 | #define d4 REG (d4) |
69 | #define d5 REG (d5) |
70 | #define d6 REG (d6) |
71 | #define d7 REG (d7) |
72 | #define a0 REG (a0) |
73 | #define a1 REG (a1) |
74 | #define a2 REG (a2) |
75 | #define a3 REG (a3) |
76 | #define a4 REG (a4) |
77 | #define a5 REG (a5) |
78 | #define a6 REG (a6) |
79 | #define a7 REG (a7) |
80 | |
81 | #define msp REG (msp) |
82 | #define usp REG (usp) |
83 | #define isp REG (isp) |
84 | #define sr REG (sr) |
85 | |
86 | #define fp0 REG (fp0) |
87 | #define fp1 REG (fp1) |
88 | #define fp2 REG (fp2) |
89 | #define fp3 REG (fp3) |
90 | #define fp4 REG (fp4) |
91 | #define fp5 REG (fp5) |
92 | #define fp6 REG (fp6) |
93 | #define fp7 REG (fp7) |
94 | |
95 | #define fpc REG (fpc) |
96 | #define fpi REG (fpi) |
97 | #define fps REG (fps) |
98 | |
99 | /* |
100 | * Define macros to handle section beginning and ends. |
101 | */ |
102 | |
103 | |
104 | #define BEGIN_CODE_DCL .text |
105 | #define END_CODE_DCL |
106 | #define BEGIN_DATA_DCL .data |
107 | #define END_DATA_DCL |
108 | #define BEGIN_CODE .text |
109 | #define END_CODE |
110 | #define BEGIN_DATA |
111 | #define END_DATA |
112 | #define BEGIN_BSS |
113 | #define END_BSS |
114 | #define END |
115 | |
116 | /* |
117 | * Following must be tailor for a particular flavor of the C compiler. |
118 | * They may need to put underscores in front of the symbols. |
119 | */ |
120 | |
121 | #define PUBLIC(sym) .globl SYM (sym) |
122 | #define EXTERN(sym) .globl SYM (sym) |
123 | |
124 | #endif |
125 | /* end of include file */ |
126 | |
127 |
Note: See TracBrowser
for help on using the repository browser.