source: rtems/cpukit/score/cpu/i386/rtems/asm.h @ 8a1636d

4.104.114.84.95
Last change on this file since 8a1636d was 8a1636d, checked in by Joel Sherrill <joel.sherrill@…>, on 04/15/98 at 22:16:22

Added bh, ch, dh, bl, cl, and dl register macros.

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