handle var len names, sync with vax
[unix-history] / usr / src / sys / vax / inline / inline.h
CommitLineData
da7c5cc6 1/*
0880b18e 2 * Copyright (c) 1984, 1986 Regents of the University of California.
da7c5cc6
KM
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
0880b18e 6 * @(#)inline.h 7.1 (Berkeley) %G%
da7c5cc6 7 */
4c6269e7
KM
8
9/*
10 * COMMENTCHAR is the character delimiting comments in the assembler.
11 * LABELCHAR is the character that separates labels from instructions.
b00f0728 12 * ARGSEPCHAR is the character that separates arguments in instructions.
4c6269e7
KM
13 */
14#define COMMENTCHAR '#'
15#define LABELCHAR ':'
b00f0728 16#define ARGSEPCHAR ','
4c6269e7
KM
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
64cf44ff 26#define MAXLINELEN 1024
4c6269e7
KM
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 */
39int bufhead, buftail;
40char 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/*
b00f0728
KM
46 * Hash table headers should be twice as big as the number of patterns.
47 * They must be a power of two.
4c6269e7
KM
48 */
49#define HSHSIZ 128
50
b00f0728
KM
51/*
52 * These tables specify the substitutions that are to be done.
53 */
4c6269e7 54struct pats {
c8869d53 55 int args;
4c6269e7
KM
56 char *name;
57 char *replace;
58 struct pats *next;
59 int size;
60};
b00f0728 61struct pats *patshdr[HSHSIZ];
4c6269e7 62extern struct pats language_ptab[], libc_ptab[], machine_ptab[];
7a971c52
MK
63extern struct pats vax_libc_ptab[], vaxsubset_libc_ptab[];
64extern struct pats vax_ptab[], vaxsubset_ptab[];
b00f0728
KM
65
66/*
67 * This table defines the set of instructions that demark the
68 * end of a basic block.
69 */
70struct inststoptbl {
71 char *name;
72 struct inststoptbl *next;
73 int size;
74};
75struct inststoptbl *inststoptblhdr[HSHSIZ];
76extern struct inststoptbl inststoptable[];
77
78/*
79 * Miscellaneous functions.
80 */
4c6269e7 81char *newline(), *copyline(), *doreplaceon();