Subversion Repositories tendra.SVN

Rev

Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
6 7u83 2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright notice,
9
 *    this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
11
 *    this list of conditions and the following disclaimer in the documentation
12
 *    and/or other materials provided with the distribution.
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific, prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 *
29
 * $Id$
30
 */
31
/*
2 7u83 32
    		 Crown Copyright (c) 1997
6 7u83 33
 
2 7u83 34
    This TenDRA(r) Computer Program is subject to Copyright
35
    owned by the United Kingdom Secretary of State for Defence
36
    acting through the Defence Evaluation and Research Agency
37
    (DERA).  It is made available to Recipients with a
38
    royalty-free licence for its use, reproduction, transfer
39
    to other parties and amendment for any purpose not excluding
40
    product development provided that any such use et cetera
41
    shall be deemed to be acceptance of the following conditions:-
6 7u83 42
 
2 7u83 43
        (1) Its Recipients shall ensure that this Notice is
44
        reproduced upon any copies or amended versions of it;
6 7u83 45
 
2 7u83 46
        (2) Any amended version of it shall be clearly marked to
47
        show both the nature of and the organisation responsible
48
        for the relevant amendment or amendments;
6 7u83 49
 
2 7u83 50
        (3) Its onward transfer from a recipient to another
51
        party shall be deemed to be that party's acceptance of
52
        these conditions;
6 7u83 53
 
2 7u83 54
        (4) DERA gives no warranty or assurance as to its
55
        quality or suitability for any purpose and DERA accepts
56
        no liability whatsoever in relation to any use to which
57
        it may be put.
58
*/
59
 
60
 
61
/*
62
$Log: inst_fmt.h,v $
63
 * Revision 1.1.1.1  1998/01/17  15:56:02  release
64
 * First version to be checked into rolling release.
65
 *
66
 * Revision 1.2  1995/12/18  13:11:40  wfs
67
 * Put hppatrans uder cvs control. Major Changes made since last release
68
 * include:
69
 * (i) PIC code generation.
70
 * (ii) Profiling.
71
 * (iii) Dynamic Initialization.
72
 * (iv) Debugging of Exception Handling and Diagnostics.
73
 *
74
 * Revision 5.2  1995/10/20  13:58:40  wfs
75
 * Declared "reg_name()" and "call_ins()" for gcc compilation.
76
 *
77
 * Revision 5.1  1995/09/15  14:09:47  wfs
78
 * Extra function declarations added to stop gcc complaining.
79
 *
80
 * Revision 5.0  1995/08/25  13:42:58  wfs
81
 * Preperation for August 25 Glue release
82
 *
83
 * Revision 3.3  1995/08/25  11:12:16  wfs
84
 * *** empty log message ***
85
 *
86
 * Revision 3.3  1995/08/25  11:12:16  wfs
87
 * *** empty log message ***
88
 *
89
 * Revision 3.1  95/04/10  16:26:57  16:26:57  wfs (William Simmonds)
90
 * Apr95 tape version.
6 7u83 91
 *
2 7u83 92
 * Revision 3.0  95/03/30  11:17:54  11:17:54  wfs (William Simmonds)
93
 * Mar95 tape version with CRCR95_178 bug fix.
6 7u83 94
 *
2 7u83 95
 * Revision 2.0  95/03/15  15:27:41  15:27:41  wfs (William Simmonds)
96
 * spec 3.1 changes implemented, tests outstanding.
6 7u83 97
 *
2 7u83 98
 * Revision 1.1  95/01/11  13:39:09  13:39:09  wfs (William Simmonds)
99
 * Initial revision
6 7u83 100
 *
2 7u83 101
*/
102
 
103
 
104
#ifndef INST_FMT_INCLUDED
105
#define INST_FMT_INCLUDED
106
 
107
#include "addrtypes.h"
108
#include "hppains.h"
109
 
6 7u83 110
extern char *ext_name(long);
2 7u83 111
 
6 7u83 112
extern void ldmb_ins(ins_p, int, int, int);
113
extern void ld_ins(ins_p, int, baseoff, int);
2 7u83 114
 
6 7u83 115
extern void st_ins(ins_p, int, baseoff);
2 7u83 116
 
6 7u83 117
extern void riir_ins(ins_p, ins_p, int, long, long, int);
2 7u83 118
 
6 7u83 119
extern void ir_ins(ins_p, ins_p, CONST char*, long, int);
2 7u83 120
 
6 7u83 121
extern void imm_to_r(long, int);
2 7u83 122
 
6 7u83 123
extern void set_ins(char*, baseoff, int);
124
extern void z_ins(ins_p);
2 7u83 125
 
6 7u83 126
extern void condrr_ins(char, ins_p, int, int, int, int);
127
extern void condri_ins(ins_p, int, long, int);
2 7u83 128
 
6 7u83 129
extern void extj_special_ins(CONST char *, int, char *, int);
130
extern void extj_reg_ins(ins_p, int);
2 7u83 131
 
6 7u83 132
extern void ret_ins(ins_p);
2 7u83 133
 
6 7u83 134
extern void ldf_ro_ins(ins_p, baseoff, int);
135
extern void ldf_rr_ins(ins_p,ins_p, int, int, int);
136
extern void ldf_ins(ins_p, baseoff, int);
137
extern void stf_ro_ins(ins_p, int, baseoff);
138
extern void stf_rr_ins(ins_p, int, int, int);
139
extern void stf_ins(ins_p, int, baseoff);
2 7u83 140
 
6 7u83 141
extern void rrf_ins(ins_p,ins_p,ins_p, int, int);
142
extern void rrrf_ins(ins_p, ins_p, int, int, int);
2 7u83 143
 
6 7u83 144
extern void rrf_cmp_ins(ins_p, int, int);
145
extern void immr_ins(ins_p, char*,char*,long,char*,int);
146
extern void ld_immr_ins(ins_p, char*,char*,long,char*,int,int);
147
extern void st_immr_ins(ins_p,int, char*,char*,long,char*,int);
148
extern void iiir_ins(ins_p,ins_p,int,int,int,int);
149
extern void bb_in(ins_p,int,int,int);
150
extern void rr_ins(ins_p, int, int);
151
extern void rrr_ins(ins_p, ins_p, int, int, int);
152
extern void ub_ins(CONST char*, int);
153
extern void cj_ins(CONST char*, int, int, int);
154
extern void st_ir_ins(ins_p, ins_p, int, ins_p, CONST char*, long, int);
155
extern void ld_ir_ins(ins_p, ins_p, ins_p, CONST char*, long, int, int);
156
extern void comb_ins(CONST char*, int, int, int);
157
extern void cmp_rrf_ins(ins_p, ins_p, ins_p, int, int);
158
extern void rrir_ins(ins_p, ins_p, int, int, long, int);
159
extern void cij_ins(CONST char*, long, int, int);
160
extern void irr_ins(ins_p, ins_p, ins_p, long, int, int);
161
extern void ld_rr_ins(ins_p, ins_p, int, int, int);
162
extern void r_ins(ins_p, int);
163
extern void out_directive(CONST char*, CONST char*);
164
extern void iir_ins(ins_p, ins_p, int, int, int);
165
extern void rir_ins(ins_p, ins_p, int, long, int);
166
extern CONST char* reg_name(int);
167
extern void call_ins(ins_p, char*, int, char*);
168
extern void outlab(char*, int);
169
extern void bl_in(ins_p, char*, int);
170
extern void ble_in(ins_p, char*, int, int);
2 7u83 171
 
172
int line,lines,nLabels;
173
 
174
#if FS_NO_ANSI_ENVIRON
6 7u83 175
typedef long FILE_POSN;
176
#define SET_FILE_POSN(A, B)		fseek((A), (B), SEEK_SET)
177
#define GET_FILE_POSN(A, B)		(B) = ftell((A))
2 7u83 178
#else
6 7u83 179
typedef fpos_t FILE_POSN;
180
#define SET_FILE_POSN(A, B)		fsetpos((A), & (B))
181
#define GET_FILE_POSN(A, B)		fgetpos((A), & (B))
2 7u83 182
#endif
183
 
184
typedef struct {
185
   FILE_POSN fpos;     /* position in outf  */
6 7u83 186
   ins_p  ins;        /* instruction       */
187
   ins_p  cc;        /* condition code    */
2 7u83 188
   int    op[4];    /* operands          */
189
   int    lab;     /* label             */
190
} psuedoIn;
191
 
192
typedef psuedoIn *pIn;
193
 
194
/* #define BLOCK 131072 */
195
 
196
#define BLOCK 65536
197
#define INCR  4096
198
 
199
pIn *pCode;
200
int *labIntro;  /*  `labIntro[lab]' will record the line number on
201
                     which label `lab' was introduced. */
202
 
203
 
204
 
205
#endif /* INST_FMT_INCLUDED */