Line -... |
Line 1... |
- |
|
1 |
/*
|
- |
|
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 |
*/
|
1 |
/*
|
31 |
/*
|
2 |
Crown Copyright (c) 1997
|
32 |
Crown Copyright (c) 1997
|
3 |
|
33 |
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
34 |
This TenDRA(r) Computer Program is subject to Copyright
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
35 |
owned by the United Kingdom Secretary of State for Defence
|
6 |
acting through the Defence Evaluation and Research Agency
|
36 |
acting through the Defence Evaluation and Research Agency
|
7 |
(DERA). It is made available to Recipients with a
|
37 |
(DERA). It is made available to Recipients with a
|
8 |
royalty-free licence for its use, reproduction, transfer
|
38 |
royalty-free licence for its use, reproduction, transfer
|
9 |
to other parties and amendment for any purpose not excluding
|
39 |
to other parties and amendment for any purpose not excluding
|
10 |
product development provided that any such use et cetera
|
40 |
product development provided that any such use et cetera
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
41 |
shall be deemed to be acceptance of the following conditions:-
|
12 |
|
42 |
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
43 |
(1) Its Recipients shall ensure that this Notice is
|
14 |
reproduced upon any copies or amended versions of it;
|
44 |
reproduced upon any copies or amended versions of it;
|
15 |
|
45 |
|
16 |
(2) Any amended version of it shall be clearly marked to
|
46 |
(2) Any amended version of it shall be clearly marked to
|
17 |
show both the nature of and the organisation responsible
|
47 |
show both the nature of and the organisation responsible
|
18 |
for the relevant amendment or amendments;
|
48 |
for the relevant amendment or amendments;
|
19 |
|
49 |
|
20 |
(3) Its onward transfer from a recipient to another
|
50 |
(3) Its onward transfer from a recipient to another
|
21 |
party shall be deemed to be that party's acceptance of
|
51 |
party shall be deemed to be that party's acceptance of
|
22 |
these conditions;
|
52 |
these conditions;
|
23 |
|
53 |
|
24 |
(4) DERA gives no warranty or assurance as to its
|
54 |
(4) DERA gives no warranty or assurance as to its
|
25 |
quality or suitability for any purpose and DERA accepts
|
55 |
quality or suitability for any purpose and DERA accepts
|
26 |
no liability whatsoever in relation to any use to which
|
56 |
no liability whatsoever in relation to any use to which
|
27 |
it may be put.
|
57 |
it may be put.
|
28 |
*/
|
58 |
*/
|
29 |
|
59 |
|
30 |
|
60 |
|
31 |
/*
|
61 |
/*
|
32 |
$Log: inst_fmt.h,v $
|
62 |
$Log: inst_fmt.h,v $
|
33 |
* Revision 1.1.1.1 1998/01/17 15:56:02 release
|
63 |
* Revision 1.1.1.1 1998/01/17 15:56:02 release
|
34 |
* First version to be checked into rolling release.
|
64 |
* First version to be checked into rolling release.
|
35 |
*
|
65 |
*
|
Line 53... |
Line 83... |
53 |
* Revision 3.3 1995/08/25 11:12:16 wfs
|
83 |
* Revision 3.3 1995/08/25 11:12:16 wfs
|
54 |
* *** empty log message ***
|
84 |
* *** empty log message ***
|
55 |
*
|
85 |
*
|
56 |
* Revision 3.3 1995/08/25 11:12:16 wfs
|
86 |
* Revision 3.3 1995/08/25 11:12:16 wfs
|
57 |
* *** empty log message ***
|
87 |
* *** empty log message ***
|
58 |
*
|
88 |
*
|
59 |
* Revision 3.1 95/04/10 16:26:57 16:26:57 wfs (William Simmonds)
|
89 |
* Revision 3.1 95/04/10 16:26:57 16:26:57 wfs (William Simmonds)
|
60 |
* Apr95 tape version.
|
90 |
* Apr95 tape version.
|
61 |
*
|
91 |
*
|
62 |
* Revision 3.0 95/03/30 11:17:54 11:17:54 wfs (William Simmonds)
|
92 |
* Revision 3.0 95/03/30 11:17:54 11:17:54 wfs (William Simmonds)
|
63 |
* Mar95 tape version with CRCR95_178 bug fix.
|
93 |
* Mar95 tape version with CRCR95_178 bug fix.
|
64 |
*
|
94 |
*
|
65 |
* Revision 2.0 95/03/15 15:27:41 15:27:41 wfs (William Simmonds)
|
95 |
* Revision 2.0 95/03/15 15:27:41 15:27:41 wfs (William Simmonds)
|
66 |
* spec 3.1 changes implemented, tests outstanding.
|
96 |
* spec 3.1 changes implemented, tests outstanding.
|
67 |
*
|
97 |
*
|
68 |
* Revision 1.1 95/01/11 13:39:09 13:39:09 wfs (William Simmonds)
|
98 |
* Revision 1.1 95/01/11 13:39:09 13:39:09 wfs (William Simmonds)
|
69 |
* Initial revision
|
99 |
* Initial revision
|
70 |
*
|
100 |
*
|
71 |
*/
|
101 |
*/
|
72 |
|
102 |
|
73 |
|
103 |
|
74 |
#ifndef INST_FMT_INCLUDED
|
104 |
#ifndef INST_FMT_INCLUDED
|
75 |
#define INST_FMT_INCLUDED
|
105 |
#define INST_FMT_INCLUDED
|
76 |
|
106 |
|
77 |
#include "addrtypes.h"
|
107 |
#include "addrtypes.h"
|
78 |
#include "hppains.h"
|
108 |
#include "hppains.h"
|
79 |
|
109 |
|
80 |
extern char *ext_name PROTO_S ( ( long ) ) ;
|
110 |
extern char *ext_name(long);
|
81 |
|
111 |
|
82 |
extern void ldmb_ins PROTO_S ( ( ins_p, int, int, int ) ) ;
|
112 |
extern void ldmb_ins(ins_p, int, int, int);
|
83 |
extern void ld_ins PROTO_S ( ( ins_p, int, baseoff, int ) ) ;
|
113 |
extern void ld_ins(ins_p, int, baseoff, int);
|
84 |
|
114 |
|
85 |
extern void st_ins PROTO_S ( ( ins_p, int, baseoff ) ) ;
|
115 |
extern void st_ins(ins_p, int, baseoff);
|
86 |
|
116 |
|
87 |
extern void riir_ins PROTO_S ( ( ins_p, ins_p, int, long, long, int ) ) ;
|
117 |
extern void riir_ins(ins_p, ins_p, int, long, long, int);
|
88 |
|
118 |
|
89 |
extern void ir_ins PROTO_S ( ( ins_p, ins_p, CONST char*, long, int ) ) ;
|
119 |
extern void ir_ins(ins_p, ins_p, CONST char*, long, int);
|
90 |
|
120 |
|
91 |
extern void imm_to_r PROTO_S ( ( long, int ) );
|
121 |
extern void imm_to_r(long, int);
|
92 |
|
122 |
|
93 |
extern void set_ins PROTO_S ( ( char*, baseoff, int ) ) ;
|
123 |
extern void set_ins(char*, baseoff, int);
|
94 |
extern void z_ins PROTO_S ( ( ins_p ) ) ;
|
124 |
extern void z_ins(ins_p);
|
95 |
|
125 |
|
96 |
extern void condrr_ins PROTO_S ( ( char, ins_p, int, int, int, int ) ) ;
|
126 |
extern void condrr_ins(char, ins_p, int, int, int, int);
|
97 |
extern void condri_ins PROTO_S ( ( ins_p, int, long, int ) ) ;
|
127 |
extern void condri_ins(ins_p, int, long, int);
|
98 |
|
128 |
|
99 |
extern void extj_special_ins PROTO_S ( (CONST char *, int, char *, int ) ) ;
|
129 |
extern void extj_special_ins(CONST char *, int, char *, int);
|
100 |
extern void extj_reg_ins PROTO_S ( ( ins_p, int ) ) ;
|
130 |
extern void extj_reg_ins(ins_p, int);
|
101 |
|
131 |
|
102 |
extern void ret_ins PROTO_S ( ( ins_p ) ) ;
|
132 |
extern void ret_ins(ins_p);
|
103 |
|
133 |
|
104 |
extern void ldf_ro_ins PROTO_S ( ( ins_p, baseoff, int ) ) ;
|
134 |
extern void ldf_ro_ins(ins_p, baseoff, int);
|
105 |
extern void ldf_rr_ins PROTO_S ( ( ins_p,ins_p, int, int, int ) ) ;
|
135 |
extern void ldf_rr_ins(ins_p,ins_p, int, int, int);
|
106 |
extern void ldf_ins PROTO_S ( ( ins_p, baseoff, int ) ) ;
|
136 |
extern void ldf_ins(ins_p, baseoff, int);
|
107 |
extern void stf_ro_ins PROTO_S ( ( ins_p, int, baseoff ) ) ;
|
137 |
extern void stf_ro_ins(ins_p, int, baseoff);
|
108 |
extern void stf_rr_ins PROTO_S ( ( ins_p, int, int, int ) ) ;
|
138 |
extern void stf_rr_ins(ins_p, int, int, int);
|
109 |
extern void stf_ins PROTO_S ( ( ins_p, int, baseoff ) ) ;
|
139 |
extern void stf_ins(ins_p, int, baseoff);
|
110 |
|
140 |
|
111 |
extern void rrf_ins PROTO_S ( ( ins_p,ins_p,ins_p, int, int ) ) ;
|
141 |
extern void rrf_ins(ins_p,ins_p,ins_p, int, int);
|
112 |
extern void rrrf_ins PROTO_S ( ( ins_p, ins_p, int, int, int ) ) ;
|
142 |
extern void rrrf_ins(ins_p, ins_p, int, int, int);
|
113 |
|
143 |
|
114 |
extern void rrf_cmp_ins PROTO_S ( ( ins_p, int, int ) ) ;
|
144 |
extern void rrf_cmp_ins(ins_p, int, int);
|
115 |
extern void immr_ins PROTO_S ( ( ins_p, char*,char*,long,char*,int ) ) ;
|
145 |
extern void immr_ins(ins_p, char*,char*,long,char*,int);
|
116 |
extern void ld_immr_ins PROTO_S ( ( ins_p, char*,char*,long,char*,int,int ) ) ;
|
146 |
extern void ld_immr_ins(ins_p, char*,char*,long,char*,int,int);
|
117 |
extern void st_immr_ins PROTO_S ( ( ins_p,int, char*,char*,long,char*,int ) ) ;
|
147 |
extern void st_immr_ins(ins_p,int, char*,char*,long,char*,int);
|
118 |
extern void iiir_ins PROTO_S ( ( ins_p,ins_p,int,int,int,int ) );
|
148 |
extern void iiir_ins(ins_p,ins_p,int,int,int,int);
|
119 |
extern void bb_in PROTO_S ( ( ins_p,int,int,int ) );
|
149 |
extern void bb_in(ins_p,int,int,int);
|
120 |
extern void rr_ins PROTO_S (( ins_p, int, int ));
|
150 |
extern void rr_ins(ins_p, int, int);
|
121 |
extern void rrr_ins PROTO_S (( ins_p, ins_p, int, int, int ));
|
151 |
extern void rrr_ins(ins_p, ins_p, int, int, int);
|
122 |
extern void ub_ins PROTO_S (( CONST char*, int ));
|
152 |
extern void ub_ins(CONST char*, int);
|
123 |
extern void cj_ins PROTO_S (( CONST char*, int, int, int ));
|
153 |
extern void cj_ins(CONST char*, int, int, int);
|
124 |
extern void st_ir_ins PROTO_S (( ins_p, ins_p, int, ins_p, CONST char*, long, int ));
|
154 |
extern void st_ir_ins(ins_p, ins_p, int, ins_p, CONST char*, long, int);
|
125 |
extern void ld_ir_ins PROTO_S (( ins_p, ins_p, ins_p, CONST char*, long, int, int ));
|
155 |
extern void ld_ir_ins(ins_p, ins_p, ins_p, CONST char*, long, int, int);
|
126 |
extern void comb_ins PROTO_S (( CONST char*, int, int, int ));
|
156 |
extern void comb_ins(CONST char*, int, int, int);
|
127 |
extern void cmp_rrf_ins PROTO_S (( ins_p, ins_p, ins_p, int, int ));
|
157 |
extern void cmp_rrf_ins(ins_p, ins_p, ins_p, int, int);
|
128 |
extern void rrir_ins PROTO_S (( ins_p, ins_p, int, int, long, int ));
|
158 |
extern void rrir_ins(ins_p, ins_p, int, int, long, int);
|
129 |
extern void cij_ins PROTO_S (( CONST char*, long, int, int ));
|
159 |
extern void cij_ins(CONST char*, long, int, int);
|
130 |
extern void irr_ins PROTO_S (( ins_p, ins_p, ins_p, long, int, int ));
|
160 |
extern void irr_ins(ins_p, ins_p, ins_p, long, int, int);
|
131 |
extern void ld_rr_ins PROTO_S (( ins_p, ins_p, int, int, int ));
|
161 |
extern void ld_rr_ins(ins_p, ins_p, int, int, int);
|
132 |
extern void r_ins PROTO_S (( ins_p, int ));
|
162 |
extern void r_ins(ins_p, int);
|
133 |
extern void out_directive PROTO_S (( CONST char*, CONST char* ));
|
163 |
extern void out_directive(CONST char*, CONST char*);
|
134 |
extern void iir_ins PROTO_S (( ins_p, ins_p, int, int, int ));
|
164 |
extern void iir_ins(ins_p, ins_p, int, int, int);
|
135 |
extern void rir_ins PROTO_S (( ins_p, ins_p, int, long, int ));
|
165 |
extern void rir_ins(ins_p, ins_p, int, long, int);
|
136 |
extern CONST char* reg_name PROTO_S (( int ));
|
166 |
extern CONST char* reg_name(int);
|
137 |
extern void call_ins PROTO_S (( ins_p, char*, int, char* ));
|
167 |
extern void call_ins(ins_p, char*, int, char*);
|
138 |
extern void outlab PROTO_S (( char*, int ));
|
168 |
extern void outlab(char*, int);
|
139 |
extern void bl_in PROTO_S (( ins_p, char*, int ));
|
169 |
extern void bl_in(ins_p, char*, int);
|
140 |
extern void ble_in PROTO_S (( ins_p, char*, int, int ));
|
170 |
extern void ble_in(ins_p, char*, int, int);
|
141 |
|
171 |
|
142 |
int line,lines,nLabels;
|
172 |
int line,lines,nLabels;
|
143 |
|
173 |
|
144 |
#if FS_NO_ANSI_ENVIRON
|
174 |
#if FS_NO_ANSI_ENVIRON
|
145 |
typedef long FILE_POSN ;
|
175 |
typedef long FILE_POSN;
|
146 |
#define SET_FILE_POSN( A, B ) fseek ( ( A ), ( B ), SEEK_SET )
|
176 |
#define SET_FILE_POSN(A, B) fseek((A), (B), SEEK_SET)
|
147 |
#define GET_FILE_POSN( A, B ) ( B ) = ftell ( ( A ) )
|
177 |
#define GET_FILE_POSN(A, B) (B) = ftell((A))
|
148 |
#else
|
178 |
#else
|
149 |
typedef fpos_t FILE_POSN ;
|
179 |
typedef fpos_t FILE_POSN;
|
150 |
#define SET_FILE_POSN( A, B ) fsetpos ( ( A ), &( B ) )
|
180 |
#define SET_FILE_POSN(A, B) fsetpos((A), & (B))
|
151 |
#define GET_FILE_POSN( A, B ) fgetpos ( ( A ), &( B ) )
|
181 |
#define GET_FILE_POSN(A, B) fgetpos((A), & (B))
|
152 |
#endif
|
182 |
#endif
|
153 |
|
183 |
|
154 |
typedef struct {
|
184 |
typedef struct {
|
155 |
FILE_POSN fpos; /* position in outf */
|
185 |
FILE_POSN fpos; /* position in outf */
|
156 |
ins_p ins; /* instruction */
|
186 |
ins_p ins; /* instruction */
|
157 |
ins_p cc; /* condition code */
|
187 |
ins_p cc; /* condition code */
|
158 |
int op[4]; /* operands */
|
188 |
int op[4]; /* operands */
|
159 |
int lab; /* label */
|
189 |
int lab; /* label */
|
160 |
} psuedoIn;
|
190 |
} psuedoIn;
|
161 |
|
191 |
|
162 |
typedef psuedoIn *pIn;
|
192 |
typedef psuedoIn *pIn;
|