source: rtems/c/src/exec/score/cpu/i386/asm.h @ 82ab443e

4.104.114.84.95
Last change on this file since 82ab443e was b9181082, checked in by Joel Sherrill <joel.sherrill@…>, on 01/29/97 at 00:13:00

Added include of targopts.h.

  • Property mode set to 100644
File size: 2.9 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 __i386_ASM_h
27#define __i386_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/score/targopts.h>
35#include <rtems/score/i386.h>
36
37/*
38 *  Recent versions of GNU cpp define variables which indicate the
39 *  need for underscores and percents.  If not using GNU cpp or
40 *  the version does not support this, then you will obviously
41 *  have to define these as appropriate.
42 */
43
44/*
45 *  Go32 suffers the same bug as __REGISTER_PREFIX__
46 */
47 
48#if __GO32__
49#undef  __USER_LABEL_PREFIX__
50#define __USER_LABEL_PREFIX__ _
51#endif
52
53#ifndef __USER_LABEL_PREFIX__
54#define __USER_LABEL_PREFIX__ _
55#endif
56
57/*
58 *  Looks like there is a bug in gcc 2.6.2 where this is not
59 *  defined correctly when configured as i386-coff and
60 *  i386-aout.
61 */
62
63#undef __REGISTER_PREFIX__
64#define __REGISTER_PREFIX__ %
65
66/*
67#ifndef __REGISTER_PREFIX__
68#define __REGISTER_PREFIX__
69#endif
70*/
71
72/* ANSI concatenation macros.  */
73
74#define CONCAT1(a, b) CONCAT2(a, b)
75#define CONCAT2(a, b) a ## b
76
77/* Use the right prefix for global labels.  */
78
79#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
80
81/* Use the right prefix for registers.  */
82
83#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
84
85#define eax REG (eax)
86#define ebx REG (ebx)
87#define ecx REG (ecx)
88#define edx REG (edx)
89#define esi REG (esi)
90#define edi REG (edi)
91#define esp REG (esp)
92#define ebp REG (ebp)
93
94#define ax REG (ax)
95#define bx REG (bx)
96#define cx REG (cx)
97#define dx REG (dx)
98#define si REG (si)
99#define di REG (di)
100#define sp REG (sp)
101#define bp REG (bp)
102
103#define ah REG (ah)
104#define al REG (al)
105
106#define cs REG (cs)
107#define ds REG (ds)
108#define es REG (es)
109#define fs REG (fs)
110#define gs REG (gs)
111#define ss REG (ss)
112
113/*
114 *  Define macros to handle section beginning and ends.
115 */
116
117
118#define BEGIN_CODE_DCL .text
119#define END_CODE_DCL
120#define BEGIN_DATA_DCL .data
121#define END_DATA_DCL
122#define BEGIN_CODE .text
123#define END_CODE
124#define BEGIN_DATA
125#define END_DATA
126#define BEGIN_BSS
127#define END_BSS
128#define END
129
130/*
131 *  Following must be tailor for a particular flavor of the C compiler.
132 *  They may need to put underscores in front of the symbols.
133 */
134
135#define PUBLIC(sym) .globl SYM (sym)
136#define EXTERN(sym) .globl SYM (sym)
137
138#endif
139/* end of include file */
140
141
Note: See TracBrowser for help on using the repository browser.