xref: /csrg-svn/sys/vax/inline/inline.h (revision 23341)
1*23341Smckusick /*
2*23341Smckusick  * Copyright (c) 1984 Regents of the University of California.
3*23341Smckusick  * All rights reserved.  The Berkeley software License Agreement
4*23341Smckusick  * specifies the terms and conditions for redistribution.
5*23341Smckusick  *
6*23341Smckusick  *	@(#)inline.h	1.3 (Berkeley) 06/08/85
7*23341Smckusick  */
816958Smckusick 
916958Smckusick /*
1016958Smckusick  * COMMENTCHAR is the character delimiting comments in the assembler.
1116958Smckusick  * LABELCHAR is the character that separates labels from instructions.
1216977Smckusick  * ARGSEPCHAR is the character that separates arguments in instructions.
1316958Smckusick  */
1416958Smckusick #define COMMENTCHAR	'#'
1516958Smckusick #define LABELCHAR	':'
1616977Smckusick #define ARGSEPCHAR	','
1716958Smckusick 
1816958Smckusick /*
1916958Smckusick  * Expansion parameters:
2016958Smckusick  *   QUEUESIZE is the number of instructions to be considered for
2116958Smckusick  *	integration of argument pushes and pops
2216958Smckusick  *   MAXLINELEN is the longest expected input line
2316958Smckusick  *   MAXARGS is the maximum number of arguments in an assembly instruction
2416958Smckusick  */
2516958Smckusick #define QUEUESIZE	16
2616958Smckusick #define MAXLINELEN	128
2716958Smckusick #define MAXARGS		10
2816958Smckusick 
2916958Smckusick /*
3016958Smckusick  * The following global variables are used to manipulate the queue of
3116958Smckusick  * recently seen instructions.
3216958Smckusick  *	line - The queue of instructions.
3316958Smckusick  *	bufhead - Pointer to next availble queue slot. It is not
3416958Smckusick  *		considered part of te instruction stream until
3516958Smckusick  *		bufhead is advanced.
3616958Smckusick  *	buftail - Pointer to last instruction in queue.
3716958Smckusick  * Note that bufhead == buftail implies that the queue is empty.
3816958Smckusick  */
3916958Smckusick int bufhead, buftail;
4016958Smckusick char line[QUEUESIZE][MAXLINELEN];
4116958Smckusick 
4216958Smckusick #define SUCC(qindex) ((qindex) + 1 == QUEUESIZE ? 0 : (qindex) + 1)
4316958Smckusick #define PRED(qindex) ((qindex) - 1 < 0 ? QUEUESIZE - 1 : (qindex) - 1)
4416958Smckusick 
4516958Smckusick /*
4616977Smckusick  * Hash table headers should be twice as big as the number of patterns.
4716977Smckusick  * They must be a power of two.
4816958Smckusick  */
4916958Smckusick #define HSHSIZ	128
5016958Smckusick 
5116977Smckusick /*
5216977Smckusick  * These tables specify the substitutions that are to be done.
5316977Smckusick  */
5416958Smckusick struct pats {
5516958Smckusick 	char	*name;
5616958Smckusick 	char	*replace;
5716958Smckusick 	struct	pats *next;
5816958Smckusick 	int	size;
5916958Smckusick };
6016977Smckusick struct pats *patshdr[HSHSIZ];
6116958Smckusick extern struct pats language_ptab[], libc_ptab[], machine_ptab[];
6216977Smckusick 
6316977Smckusick /*
6416977Smckusick  * This table defines the set of instructions that demark the
6516977Smckusick  * end of a basic block.
6616977Smckusick  */
6716977Smckusick struct inststoptbl {
6816977Smckusick 	char	*name;
6916977Smckusick 	struct	inststoptbl *next;
7016977Smckusick 	int	size;
7116977Smckusick };
7216977Smckusick struct inststoptbl *inststoptblhdr[HSHSIZ];
7316977Smckusick extern struct inststoptbl inststoptable[];
7416977Smckusick 
7516977Smckusick /*
7616977Smckusick  * Miscellaneous functions.
7716977Smckusick  */
7816958Smckusick char *newline(), *copyline(), *doreplaceon();
79