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