xref: /csrg-svn/sys/vax/inline/inline.h (revision 16977)
116958Smckusick /* Copyright (c) 1984 Regents of the University of California */
216958Smckusick 
3*16977Smckusick /* @(#)inline.h	1.2	(Berkeley)	08/20/84	*/
416958Smckusick 
516958Smckusick /*
616958Smckusick  * COMMENTCHAR is the character delimiting comments in the assembler.
716958Smckusick  * LABELCHAR is the character that separates labels from instructions.
8*16977Smckusick  * ARGSEPCHAR is the character that separates arguments in instructions.
916958Smckusick  */
1016958Smckusick #define COMMENTCHAR	'#'
1116958Smckusick #define LABELCHAR	':'
12*16977Smckusick #define ARGSEPCHAR	','
1316958Smckusick 
1416958Smckusick /*
1516958Smckusick  * Expansion parameters:
1616958Smckusick  *   QUEUESIZE is the number of instructions to be considered for
1716958Smckusick  *	integration of argument pushes and pops
1816958Smckusick  *   MAXLINELEN is the longest expected input line
1916958Smckusick  *   MAXARGS is the maximum number of arguments in an assembly instruction
2016958Smckusick  */
2116958Smckusick #define QUEUESIZE	16
2216958Smckusick #define MAXLINELEN	128
2316958Smckusick #define MAXARGS		10
2416958Smckusick 
2516958Smckusick /*
2616958Smckusick  * The following global variables are used to manipulate the queue of
2716958Smckusick  * recently seen instructions.
2816958Smckusick  *	line - The queue of instructions.
2916958Smckusick  *	bufhead - Pointer to next availble queue slot. It is not
3016958Smckusick  *		considered part of te instruction stream until
3116958Smckusick  *		bufhead is advanced.
3216958Smckusick  *	buftail - Pointer to last instruction in queue.
3316958Smckusick  * Note that bufhead == buftail implies that the queue is empty.
3416958Smckusick  */
3516958Smckusick int bufhead, buftail;
3616958Smckusick char line[QUEUESIZE][MAXLINELEN];
3716958Smckusick 
3816958Smckusick #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1)
3916958Smckusick #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1)
4016958Smckusick 
4116958Smckusick /*
42*16977Smckusick  * Hash table headers should be twice as big as the number of patterns.
43*16977Smckusick  * They must be a power of two.
4416958Smckusick  */
4516958Smckusick #define HSHSIZ	128
4616958Smckusick 
47*16977Smckusick /*
48*16977Smckusick  * These tables specify the substitutions that are to be done.
49*16977Smckusick  */
5016958Smckusick struct pats {
5116958Smckusick 	char	*name;
5216958Smckusick 	char	*replace;
5316958Smckusick 	struct	pats *next;
5416958Smckusick 	int	size;
5516958Smckusick };
56*16977Smckusick struct pats *patshdr[HSHSIZ];
5716958Smckusick extern struct pats language_ptab[], libc_ptab[], machine_ptab[];
58*16977Smckusick 
59*16977Smckusick /*
60*16977Smckusick  * This table defines the set of instructions that demark the
61*16977Smckusick  * end of a basic block.
62*16977Smckusick  */
63*16977Smckusick struct inststoptbl {
64*16977Smckusick 	char	*name;
65*16977Smckusick 	struct	inststoptbl *next;
66*16977Smckusick 	int	size;
67*16977Smckusick };
68*16977Smckusick struct inststoptbl *inststoptblhdr[HSHSIZ];
69*16977Smckusick extern struct inststoptbl inststoptable[];
70*16977Smckusick 
71*16977Smckusick /*
72*16977Smckusick  * Miscellaneous functions.
73*16977Smckusick  */
7416958Smckusick char *newline(), *copyline(), *doreplaceon();
75