xref: /original-bsd/sys/tahoe/inline/inline.h (revision 2301fdfb)
1 /*
2  * Copyright (c) 1984 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)inline.h	1.2 (Berkeley) 02/24/86
7  */
8 
9 /*
10  * COMMENTCHAR is the character delimiting comments in the assembler.
11  * LABELCHAR is the character that separates labels from instructions.
12  * ARGSEPCHAR is the character that separates arguments in instructions.
13  */
14 #define COMMENTCHAR	'#'
15 #define LABELCHAR	':'
16 #define ARGSEPCHAR	','
17 
18 /*
19  * Expansion parameters:
20  *   QUEUESIZE is the number of instructions to be considered for
21  *	integration of argument pushes and pops
22  *   MAXLINELEN is the longest expected input line
23  *   MAXARGS is the maximum number of arguments in an assembly instruction
24  */
25 #define QUEUESIZE	16
26 #define MAXLINELEN	128
27 #define MAXARGS		10
28 
29 /*
30  * The following global variables are used to manipulate the queue of
31  * recently seen instructions.
32  *	line - The queue of instructions.
33  *	bufhead - Pointer to next availble queue slot. It is not
34  *		considered part of te instruction stream until
35  *		bufhead is advanced.
36  *	buftail - Pointer to last instruction in queue.
37  * Note that bufhead == buftail implies that the queue is empty.
38  */
39 int bufhead, buftail;
40 char line[QUEUESIZE][MAXLINELEN];
41 
42 #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1)
43 #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1)
44 
45 /*
46  * Hash table headers should be twice as big as the number of patterns.
47  * They must be a power of two.
48  */
49 #define HSHSIZ	128
50 
51 /*
52  * These tables specify the substitutions that are to be done.
53  */
54 struct pats {
55 	int	args;
56 	char	*name;
57 	char	*replace;
58 	struct	pats *next;
59 	int	size;
60 };
61 struct pats *patshdr[HSHSIZ];
62 extern struct pats language_ptab[], libc_ptab[], machine_ptab[];
63 
64 /*
65  * This table defines the set of instructions that demark the
66  * end of a basic block.
67  */
68 struct inststoptbl {
69 	char	*name;
70 	struct	inststoptbl *next;
71 	int	size;
72 };
73 struct inststoptbl *inststoptblhdr[HSHSIZ];
74 extern struct inststoptbl inststoptable[];
75 
76 /*
77  * Miscellaneous functions.
78  */
79 char *newline(), *copyline(), *doreplaceon();
80