source: rtems/cpukit/score/cpu/h8300/rtems/asm.h @ b8ed8a9f

4.104.114.84.95
Last change on this file since b8ed8a9f was b8ed8a9f, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/21/04 at 08:25:23

2004-11-12 Ralf Corsepius <ralf.corsepius@…>

  • asm.h: Add doxygen preamble.
  • Property mode set to 100644
File size: 2.8 KB
Line 
1/**
2 * @file rtems/asm.h
3 *
4 *  This include file attempts to address the problems
5 *  caused by incompatible flavors of assemblers and
6 *  toolsets.  It primarily addresses variations in the
7 *  use of leading underscores on symbols and the requirement
8 *  that register names be preceded by a %.
9 */
10
11/*
12 *  NOTE: The spacing in the use of these macros
13 *        is critical to them working as advertised.
14 *
15 *  COPYRIGHT:
16 *
17 *  This file is based on similar code found in newlib available
18 *  from ftp.cygnus.com.  The file which was used had no copyright
19 *  notice.  This file is freely distributable as long as the source
20 *  of the file is noted.  This file is:
21 *
22 * 
23 *  COPYRIGHT (c) 1989-1999.
24 *  On-Line Applications Research Corporation (OAR).
25 * 
26 *  The license and distribution terms for this file may be
27 *  found in the file LICENSE in this distribution or at
28 *  http://www.rtems.com/license/LICENSE.
29 * 
30 *  $Id$
31 */
32
33#ifndef __H8300_CPU_ASM_h
34#define __H8300_CPU_ASM_h
35
36/*
37 *  Indicate we are in an assembly file and get the basic CPU definitions.
38 */
39
40#define ASM
41#include <rtems/score/h8300.h>
42
43/*
44 *  Recent versions of GNU cpp define variables which indicate the
45 *  need for underscores and percents.  If not using GNU cpp or
46 *  the version does not support this, then you will obviously
47 *  have to define these as appropriate.
48 */
49
50#ifndef __USER_LABEL_PREFIX__
51#define __USER_LABEL_PREFIX__ _
52#endif
53
54#ifndef __REGISTER_PREFIX__
55#define __REGISTER_PREFIX__
56#endif
57
58/* ANSI concatenation macros.  */
59
60#define CONCAT1(a, b) CONCAT2(a, b)
61#define CONCAT2(a, b) a ## b
62
63/* Use the right prefix for global labels.  */
64
65#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
66
67/* Use the right prefix for registers.  */
68
69#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
70
71/*
72 *  define macros for all of the registers on this CPU
73 *
74 *  EXAMPLE:     #define d0 REG (d0)
75 */
76#define r0      REG(r0)
77#define r1      REG(r1)
78#define r2      REG(r2)
79#define r3      REG(r3)
80#define r4      REG(r4)
81#define r5      REG(r5)
82#define r6      REG(r6)
83#define r7      REG(r7)
84
85#define er0     REG(er0)
86#define er1     REG(er1)
87#define er2     REG(er2)       
88#define er3     REG(er3)       
89#define er4     REG(er4)       
90#define er5     REG(er5)       
91#define er6     REG(er6)       
92#define er7     REG(er7)       
93
94#define sp      REG(sp)
95
96/*
97 *  Define macros to handle section beginning and ends.
98 */
99
100
101#define BEGIN_CODE_DCL .text
102#define END_CODE_DCL
103#define BEGIN_DATA_DCL .data
104#define END_DATA_DCL
105#define BEGIN_CODE asm ( ".text
106#define END_CODE ");
107#define BEGIN_DATA
108#define END_DATA
109#define BEGIN_BSS
110#define END_BSS
111#define END
112
113/*
114 *  Following must be tailor for a particular flavor of the C compiler.
115 *  They may need to put underscores in front of the symbols.
116 */
117
118#define PUBLIC(sym) .globl SYM (sym)
119#define EXTERN(sym) .globl SYM (sym)
120
121#endif
122/* end of include file */
123
124        asm( \".h8300h\" );
Note: See TracBrowser for help on using the repository browser.