Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/* 80x86/out.c */
32
 
33
/**********************************************************************
34
$Author: release $
35
$Date: 1998/01/17 15:55:52 $
36
$Revision: 1.1.1.1 $
37
$Log: out.c,v $
38
 * Revision 1.1.1.1  1998/01/17  15:55:52  release
39
 * First version to be checked into rolling release.
40
 *
41
 * Revision 1.4  1997/04/17  11:55:58  pwe
42
 * dwarf2 improvements
43
 *
44
 * Revision 1.3  1997/03/20  16:24:02  pwe
45
 * dwarf2
46
 *
47
 * Revision 1.2  1995/01/30  12:56:38  pwe
48
 * Ownership -> PWE, tidy banners
49
 *
50
 * Revision 1.1  1994/10/27  14:15:22  jmf
51
 * Initial revision
52
 *
53
 * Revision 1.1  1994/07/12  14:38:46  jmf
54
 * Initial revision
55
 *
56
**********************************************************************/
57
 
58
 
59
/*******************************************************************
60
                                out.c
61
 
62
   defines the low level output routines
63
 
64
*******************************************************************/
65
 
66
#include "config.h"
67
#include "common_types.h"
68
#include "basicread.h"
69
#include "flags.h"
70
#include "localflags.h"
71
#include "instr.h"
72
#include "messages_8.h"
73
#include "out.h"
74
 
75
#ifdef NEWDWARF
76
#include "dw2_config.h"
77
#endif
78
 
79
 
80
/* VARIABLES */
81
/* All variables initialised */
82
 
83
FILE * fpout;	/* init by outinit */
84
 
85
#ifdef NEWDWARF
86
long instr_count = -1;
87
#endif
88
 
89
 
90
/* PROCEDURES */
91
 
92
int outinit
93
    PROTO_N ( (intermed) )
94
    PROTO_T ( char *intermed )
95
{
96
  fpout = fopen (intermed, "w");
97
  return (fpout != (FILE *) 0);
98
}
99
 
100
void outc
101
    PROTO_N ( (c) )
102
    PROTO_T ( char c )
103
{
104
  int   st = fputc (c, fpout);
105
  if (st == EOF) {
106
    failer (BAD_OUTPUT);
107
    exit(EXIT_FAILURE);
108
  };
109
}
110
 
111
void outs
112
    PROTO_N ( (s) )
113
    PROTO_T ( char *s )
114
{
115
  int   st = fputs (s, fpout);
116
  if (st == EOF) {
117
    failer (BAD_OUTPUT);
118
    exit(EXIT_FAILURE);
119
  };
120
}
121
 
122
 
123
 
124
 
125
void outnl
126
    PROTO_Z ()
127
{
128
 
129
  int   st = fputs ("\n", fpout);
130
  if (st == EOF) {
131
    failer (BAD_OUTPUT);
132
    exit(EXIT_FAILURE);
133
  };
134
 
135
#ifdef NEWDWARF
136
  instr_count = -1;
137
#endif
138
  last_jump_label = -1;
139
  keep_short = is80586;
140
  return;
141
}
142
 
143
 
144
 
145
void outn
146
    PROTO_N ( (n) )
147
    PROTO_T ( long n )
148
{
149
  int   st = fprintf (fpout, "%ld", n);
150
  if (st == EOF) {
151
    failer (BAD_OUTPUT);
152
    exit(EXIT_FAILURE);
153
  };
154
 
155
}
156
 
157
void outhex
158
    PROTO_N ( (n) )
159
    PROTO_T ( int n )
160
{
161
  int   st = fprintf (fpout, "0x%x", (unsigned int)n);
162
  if (st == EOF) {
163
    failer (BAD_OUTPUT);
164
    exit(EXIT_FAILURE);
165
  };
166
 
167
}