Subversion Repositories tendra.SVN

Rev

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
 
32
 
33
/*
34
			    VERSION INFORMATION
35
			    ===================
36
 
37
--------------------------------------------------------------------------
38
$Header: /u/g/release/CVSROOT/Source/src/installers/sparc/common/labels.c,v 1.1.1.1 1998/01/17 15:55:54 release Exp $
39
--------------------------------------------------------------------------
40
$Log: labels.c,v $
41
 * Revision 1.1.1.1  1998/01/17  15:55:54  release
42
 * First version to be checked into rolling release.
43
 *
44
 * Revision 1.3  1997/08/23  13:53:52  pwe
45
 * initial ANDF-DE
46
 *
47
 * Revision 1.2  1995/05/26  12:59:00  john
48
 * Reformatting
49
 *
50
 * Revision 1.1.1.1  1995/03/13  10:18:41  john
51
 * Entered into CVS
52
 *
53
 * Revision 1.3  1994/07/07  16:11:33  djch
54
 * Jul94 tape
55
 *
56
 * Revision 1.3  1994/07/07  16:11:33  djch
57
 * Jul94 tape
58
 *
59
 * Revision 1.2  1994/06/13  12:55:11  djch
60
 * added assert to spot uninitialized labels
61
 *
62
 * Revision 1.1  1994/05/03  14:49:40  djch
63
 * Initial revision
64
 *
65
 * Revision 1.2  93/09/27  14:46:44  14:46:44  ra (Robert Andrews)
66
 * Introduce the variable lab_prefix to stand for the label prefix.
67
 * 
68
 * Revision 1.1  93/06/24  14:58:34  14:58:34  ra (Robert Andrews)
69
 * Initial revision
70
 * 
71
--------------------------------------------------------------------------
72
*/
73
 
74
 
75
#define SPARCTRANS_CODE
76
#include "config.h"
77
#include "common_types.h"
78
#include "myassert.h"
79
#include "addrtypes.h"
80
#include "regexps.h"
81
#include "labels.h"
82
#include "out.h"
83
 
84
 
85
/*
86
  LABEL PREFIX
87
*/
88
 
89
char *lab_prefix = "" ;
90
 
91
 
92
/*
93
  CURRENT LABEL NUMBER
94
  The count starts at 50 to avoid confusion with registers.
95
*/
96
 
97
static int last_label = 50 ;
98
 
99
 
100
/*
101
  ROUND UP CURRENT LABEL NUMBER
102
  This rounds the current label number up to the next multiple of 
103
  100.  It is called at the start of each procedure to aid 
104
  readability.
105
*/
106
 
107
void seed_label 
108
    PROTO_Z (){
109
  int old_last_label = last_label ;
110
  last_label = ( ( last_label + 100 ) / 100 ) * 100 ;
111
  assert ( last_label >= old_last_label ) ;
112
  return ;
113
}
114
 
115
 
116
/*
117
    CALCULATE NEXT LABEL NUMBER
118
*/
119
 
120
int new_label 
121
    PROTO_Z (){
122
  last_label++ ;
123
  return ( last_label ) ;
124
}	
125
 
126
 
127
/*
128
  PRINT A LABEL
129
*/
130
void set_label 
131
    PROTO_N ( ( l ) )
132
    PROTO_T ( int l ){
133
  outs ( lab_prefix ) ;
134
  outn ( l ) ;
135
  outs ( ":\n" ) ;
136
  assert (l > 100);
137
  return ;
138
}