xref: /csrg-svn/sys/vax/inline/inline.h (revision 26905)
123341Smckusick /*
223341Smckusick  * Copyright (c) 1984 Regents of the University of California.
323341Smckusick  * All rights reserved.  The Berkeley software License Agreement
423341Smckusick  * specifies the terms and conditions for redistribution.
523341Smckusick  *
6*26905Smckusick  *	@(#)inline.h	1.5 (Berkeley) 03/18/86
723341Smckusick  */
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
26*26905Smckusick #define MAXLINELEN	1024
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 {
5524382Smckusick 	int	args;
5616958Smckusick 	char	*name;
5716958Smckusick 	char	*replace;
5816958Smckusick 	struct	pats *next;
5916958Smckusick 	int	size;
6016958Smckusick };
6116977Smckusick struct pats *patshdr[HSHSIZ];
6216958Smckusick extern struct pats language_ptab[], libc_ptab[], machine_ptab[];
6316977Smckusick 
6416977Smckusick /*
6516977Smckusick  * This table defines the set of instructions that demark the
6616977Smckusick  * end of a basic block.
6716977Smckusick  */
6816977Smckusick struct inststoptbl {
6916977Smckusick 	char	*name;
7016977Smckusick 	struct	inststoptbl *next;
7116977Smckusick 	int	size;
7216977Smckusick };
7316977Smckusick struct inststoptbl *inststoptblhdr[HSHSIZ];
7416977Smckusick extern struct inststoptbl inststoptable[];
7516977Smckusick 
7616977Smckusick /*
7716977Smckusick  * Miscellaneous functions.
7816977Smckusick  */
7916958Smckusick char *newline(), *copyline(), *doreplaceon();
80