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
/* 	$Id: labels.c,v 1.1.1.1 1998/01/17 15:56:00 release Exp $	 */
32
 
33
#ifndef lint
34
static char vcid[] = "$Id: labels.c,v 1.1.1.1 1998/01/17 15:56:00 release Exp $";
35
#endif /* lint */
36
 
37
/*   
38
  labels.c
39
  create and set program labels;
40
  The setting of a label clears all memory of the contents of
41
  the registers - see regexps.c
42
*/
43
 
44
/*
45
$Log: labels.c,v $
46
 * Revision 1.1.1.1  1998/01/17  15:56:00  release
47
 * First version to be checked into rolling release.
48
 *
49
 * Revision 1.2  1995/04/07  11:04:31  john
50
 * Changes to assembler output.
51
 *
52
 * Revision 1.1.1.1  1995/03/23  10:39:12  john
53
 * Entered into CVS
54
 *
55
 * Revision 1.4  1995/03/23  10:08:36  john
56
 * Added support for scheduler
57
 *
58
*/
59
 
60
#include "config.h"
61
#include "regexps.h"
62
#include "ibinasm.h"
63
#include "out_ba.h"
64
#if DO_SCHEDULE
65
#include "scheduler.h"
66
#endif
67
#include "inst_fmt.h"
68
#include "labels.h"
69
#include "xalloc.h"
70
extern  FILE * as_file;
71
 
72
int   last_label = 31;
73
 
74
int   new_label
75
    PROTO_Z ()
76
{
77
        last_label++;
78
  return last_label;
79
}
80
 
81
void set_label
82
    PROTO_N ( ( l ) )
83
    PROTO_T ( int l )
84
{
85
#if DO_SCHEDULE
86
  Instruction new_ins = getinst();
87
  Instruction_data ins_dat  = get_new_ins_data();
88
#endif
89
  char * binasm_data;
90
#if DO_SCHEDULE
91
  char * outline = (char*)xcalloc(80,sizeof(char));
92
  setclass(new_ins,class_null);
93
  setlabel(new_ins,l);
94
  setsets_pc(new_ins,true);
95
#endif
96
  clear_all ();
97
  if (as_file){
98
#if !DO_SCHEDULE    
99
    fprintf (as_file, "$%d:\n", l);
100
#else
101
    sprintf(outline,"$%d:\n",l);
102
#endif
103
  }
104
 
105
/*  setdata(new_ins,outline);*/
106
  binasm_data = out_common(-l,ilabel);
107
#if DO_SCHEDULE
108
  set_instruction_text(ins_dat,outline);
109
  set_instruction_binasm(ins_dat,binasm_data);
110
  setdata(new_ins,ins_dat);
111
/*
112
  setbase_label(new_ins,l);
113
  setoffset_label(new_ins,0);
114
  setsize_label(new_ins,0);*/
115
  process_instruction(new_ins);
116
#endif
117
  /*add_instruction(new_ins);*/
118
  return;
119
}
120
 
121
void set_label_no_clear
122
    PROTO_N ( ( l ) )
123
    PROTO_T ( int l )
124
{
125
  if (as_file)
126
    fprintf (as_file, "$%d:\n", l);
127
  out_common(-l,ilabel);
128
}