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 __NO_CPU_ASM_h |
---|
27 | #define __NO_CPU_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 <no_cpu.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 | /* |
---|
65 | * define macros for all of the registers on this CPU |
---|
66 | * |
---|
67 | * EXAMPLE: #define d0 REG (d0) |
---|
68 | */ |
---|
69 | |
---|
70 | /* |
---|
71 | * Define macros to handle section beginning and ends. |
---|
72 | */ |
---|
73 | |
---|
74 | |
---|
75 | #define BEGIN_CODE_DCL .text |
---|
76 | #define END_CODE_DCL |
---|
77 | #define BEGIN_DATA_DCL .data |
---|
78 | #define END_DATA_DCL |
---|
79 | #define BEGIN_CODE .text |
---|
80 | #define END_CODE |
---|
81 | #define BEGIN_DATA |
---|
82 | #define END_DATA |
---|
83 | #define BEGIN_BSS |
---|
84 | #define END_BSS |
---|
85 | #define END |
---|
86 | |
---|
87 | /* |
---|
88 | * Following must be tailor for a particular flavor of the C compiler. |
---|
89 | * They may need to put underscores in front of the symbols. |
---|
90 | */ |
---|
91 | |
---|
92 | #define PUBLIC(sym) .globl SYM (sym) |
---|
93 | #define EXTERN(sym) .globl SYM (sym) |
---|
94 | |
---|
95 | #endif |
---|
96 | /* end of include file */ |
---|
97 | |
---|
98 | |
---|