File: label.h

package info (click to toggle)
crasm 1.8-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 376 kB
  • sloc: ansic: 3,505; makefile: 65
file content (105 lines) | stat: -rwxr-xr-x 2,611 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*  Copyright (C) 1987- Leon Bottou
 * 
 *  This is free documentation; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License as
 *  published by the Free Software Foundation; either version 2 of
 *  the License, or (at your option) any later version.
 * 
 *  The GNU General Public License's references to "object code"
 *  and "executables" are to be interpreted as the output of any
 *  document formatting or typesetting system, including
 *  intermediate and printed output.
 * 
 *  This manual is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public
 *  License along with this manual. Otherwise check the web site
 *  of the Free Software Foundation at http://www.fsf.org.
 */
/*
	crasm: label.h
	definition des labels
	LYB 9/87
*/


#ifndef LABEL_H
#define LABEL_H

#define LABLEN 48

struct label
{	struct label *left,*right;
	char name[LABLEN];
	byte flags,type;
	short modifier;
	int (*ptr)();
	int value;
};


struct result
{	byte flags,type;
	short modifier;
	int (*ptr)();
	long value;
};


/* type */
#define L_MNEMO		-1
#define L_MACRO		2
#define L_ABSOLUTE	3
#define L_RELATIVE	4
#define L_REGS		5
#define L_DIRECTBIT	6	/* etc...	*/


/* flags
modifier < 0 =>         size field allowed 68k-like	*/


#define UNDEF		(1<<0)
#define FORWARD		(1<<1)
#define USED		(1<<2)
#define NOREDEF		(1<<3)

#define NOLABEL		(1<<4)	/* pour mnemos uniquement */
#define DEFLABEL	(1<<5)
#define DEFMACRO	(1<<6)
#define DEFCOND		(1<<7)


/* external: label.c */
extern int checklabel(char *name);
extern struct label *searchlabel(char *name);
extern struct label *findlabel(char *name);
extern struct result *parse(char *expr);
extern struct label *makelabel(char *name, unsigned char flags, unsigned char type);
extern struct label *deflabel(char *name, unsigned char flags, unsigned char type, int value);
extern void init_label_list(struct label *array);
extern void undeflabels(struct label *q);

/* external: xref.c */
extern void printlabel(struct label *label);
extern void result(void);
extern void xref(void);

/* external: parse.c */
extern struct result *parse(char *expr);

/* external: macros.c */
extern int macrocall(struct label *labmacro, int status, char *oper);

/* external: pseudos.c */
extern void checktype(struct result *r, int type);


/* common */
struct label *lroot;
struct label *starlabel;

#endif