OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [cpu/] [i386/] [asm.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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-1997.
21
 *  On-Line Applications Research Corporation (OAR).
22
 *
23
 *  asm.h,v 1.16 2000/08/25 17:30:13 joel Exp
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
#ifndef ASM
34
#define ASM
35
#endif
36
#include <rtems/score/cpuopts.h>
37
#include <rtems/score/i386.h>
38
 
39
/*
40
 *  Recent versions of GNU cpp define variables which indicate the
41
 *  need for underscores and percents.  If not using GNU cpp or
42
 *  the version does not support this, then you will obviously
43
 *  have to define these as appropriate.
44
 */
45
 
46
/*
47
 *  Looks like there is a bug in gcc 2.6.2 where this is not
48
 *  defined correctly when configured as i386-coff and
49
 *  i386-aout.
50
 */
51
 
52
#undef __REGISTER_PREFIX__
53
#define __REGISTER_PREFIX__ %
54
 
55
/*
56
#ifndef __REGISTER_PREFIX__
57
#define __REGISTER_PREFIX__
58
#endif
59
*/
60
 
61
/* ANSI concatenation macros.  */
62
 
63
#define CONCAT1(a, b) CONCAT2(a, b)
64
#define CONCAT2(a, b) a ## b
65
 
66
/* Use the right prefix for global labels.  */
67
 
68
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
69
 
70
/* Use the right prefix for registers.  */
71
 
72
#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
73
 
74
#define eax REG (eax)
75
#define ebx REG (ebx)
76
#define ecx REG (ecx)
77
#define edx REG (edx)
78
#define esi REG (esi)
79
#define edi REG (edi)
80
#define esp REG (esp)
81
#define ebp REG (ebp)
82
#define cr0 REG (cr0)
83
 
84
#define ax REG (ax)
85
#define bx REG (bx)
86
#define cx REG (cx)
87
#define dx REG (dx)
88
#define si REG (si)
89
#define di REG (di)
90
#define sp REG (sp)
91
#define bp REG (bp)
92
 
93
#define ah REG (ah)
94
#define bh REG (bh)
95
#define ch REG (ch)
96
#define dh REG (dh)
97
 
98
#define al REG (al)
99
#define bl REG (bl)
100
#define cl REG (cl)
101
#define dl REG (dl)
102
 
103
#define cs REG (cs)
104
#define ds REG (ds)
105
#define es REG (es)
106
#define fs REG (fs)
107
#define gs REG (gs)
108
#define ss REG (ss)
109
 
110
/*
111
 *  Define macros to handle section beginning and ends.
112
 */
113
 
114
 
115
#define BEGIN_CODE_DCL .text
116
#define END_CODE_DCL
117
#define BEGIN_DATA_DCL .data
118
#define END_DATA_DCL
119
#define BEGIN_CODE .text
120
#define END_CODE
121
#define BEGIN_DATA .data
122
#define END_DATA
123
#define BEGIN_BSS .bss
124
#define END_BSS
125
#define END
126
 
127
/*
128
 *  Following must be tailor for a particular flavor of the C compiler.
129
 *  They may need to put underscores in front of the symbols.
130
 */
131
 
132
#define PUBLIC(sym) .globl SYM (sym)
133
#define EXTERN(sym) .globl SYM (sym)
134
 
135
#endif
136
/* end of include file */
137
 
138
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.